为了账号安全,请及时绑定邮箱和手机立即绑定

access toekn

出现了Exception in thread "main" net.sf.json.JSONException: JSONObject["expires_in"] not found.这个问题

 public static AccessToken getAccessToken() throws Exception {
        // TODO code application logic here
       AccessToken token = new AccessToken();
        String url = ACCESS_TOKEN_URL.replace("APPID", APPID).replace("APPSECRET", APPSECRET);
        WeixinUtil wx=new WeixinUtil();
        System.out.println(url);
        
        while(true){
            JSONObject jsonObject =wx.httpsRequest(url,"GET",null);
            if(null != jsonObject){
           
                token.setToken(jsonObject.getString("access_token"));
                token.setExpiresIn(jsonObject.getInt("expires_in"));
//                获取到的access_tocken值可以写入到文本文件中供其他业务逻辑调用,实例中只打印了没有保存到文件
               System.out.println("获取成功"+token.getToken()+"||expires_in="+token.getExpiresIn());
               
            }
            //休眠1小时57分钟,提前3分钟获取新的access_token
            sleep((7200-7000)*1000);
        }


正在回答

1 回答

这里的选框坐标其实就是其左上角(left-top-corner)的坐标,因为左上角坐标没动,所以不需要重设坐标。...

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Java微信公众号开发进阶
  • 参与学习       87764    人
  • 解答问题       226    个

Java微信公众号开发的进阶课程,在入门的基础上更加深入

进入课程

access toekn

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信