关于wx.checkSession(OBJECT)一直失败
if (token) { wx.checkSession({ success: function (){ console.log( 'hasSession' ) self.getHomeData() }, fail: function (res){ console.log(res) console.log( 'noSession' ) self.login(); } }) } else { console.log( 'noToken' ) self.login(); } |
Object {errMsg: “checkSession:fail session time out, need relogin”}errMsg: “checkSession:fail session time out, need relogin”__proto__: Object
index.js [sm]:63 noSession
每次都是走fail,请问是什么原因
2 回复
走 fail 说明用户登录失效了,需要 relogin。参看文档 https://mp.weixin.qq.com/debug/wxadoc/dev/api/api-login.html#wxchecksessionobject