access toekn
出現(xiàn)了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值可以寫入到文本文件中供其他業(yè)務(wù)邏輯調(diào)用,實例中只打印了沒有保存到文件 ???????????????System.out.println("獲取成功"+token.getToken()+"||expires_in="+token.getExpiresIn()); ??????????????? ????????????} ????????????//休眠1小時57分鐘,提前3分鐘獲取新的access_token ????????????sleep((7200-7000)*1000); ????????}
2022-03-23
這里的選框坐標(biāo)其實就是其左上角(left-top-corner)的坐標(biāo),因為左上角坐標(biāo)沒動,所以不需要重設(shè)坐標(biāo)。...沒基礎(chǔ)看什么