小程序登录接口(jscode2session)返回参数异常
发布于 5 年前 作者 yanggao 10756 次浏览 来自 问答

在开放平台代小程序实现业务中,调用小程序登录接口(jscode2session),有时候第一次请求会返回:{“errcode”:40001,“errmsg”:“invalid credential, access_token is invalid or not latest, hints: [ req_id: PfcfEMuhE-3QgLLa ]”},连续请求几次才会返回正常结果,麻烦技术看一下这个问题;

接口:https://api.weixin.qq.com/sns/component/jscode2session?appid=wx75a20606bbd4a02e&js_code=061Mcx000S7gAK1zY2100yimQv0Mcx0V&grant_type=authorization_code&component_appid=wx352c127498b5e505&component_access_token=xxx

第一次请求时间:2020-11-05 11:28:20 返回:{“errcode”:40001,“errmsg”:“invalid credential, access_token is invalid or not latest, hints: [ req_id: PfcfEMuhE-3QgLLa ]”}

第二次请求时间:2020-11-05 11:30:02 返回正常:{“session_key”:“Mtwl246…”,“openid”:“or_UG…q1eo”}

第三次请求时间:2020-11-05 11:32:35 返回:{“errcode”:40001,“errmsg”:“invalid credential, access_token is invalid or not latest, hints: [ req_id: PfcfEMuhE-3QgLLa ]”}

回到顶部