亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

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微信公眾號開發進階
  • 參與學習       87742    人
  • 解答問題       343    個

Java微信公眾號開發的進階課程,在入門的基礎上更加深入

進入課程

access toekn

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號