明明時剛獲取的tocken,然后直接拿去獲取小程序碼,返回結(jié)果顯示tocken已經(jīng)過期。代碼如下: @Test public void httpTest(){ String url = "https://api.weixin.qq.com/cgi-bin/token"; String params ="grant_type=client_credential&appid="+ appId +"&secret=" + secret; String result = HttpRequest.sendGet(url,params); System.out.println("---->"); String tocken = result.toLowerCase(); String Codeurl = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=" + tocken; String codeParms = "page=/index/index&width=200&scene=1&is_hyaline=false&auto_color=false&line_color={“r”:”0”,”g”:”0”,”b”:”0”}"; String codeRes = HttpRequest.sendPost(Codeurl, codeParms); System.out.println("獲取二維碼成功!"); System.out.println(codeRes); }然后返回結(jié)果時這樣的:{"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest hint: [ZrecEa05114689!]"}不知小伙伴們有沒有遇到過這樣的問題的。求大神能否幫我解決一下啊!在線等!
小程序tocken過期
慕村225694
2019-03-19 18:15:04