APP-SERVICE-SDK:setStorageSync:fail Error: Failed To Send Sync;at App log function;at api request success callback function
Error: APP-SERVICE-SDK:setStorageSync:fail Error: Failed To Send Sync
at new t ([publib]:7:10135)
at Oo ([publib]:8:6460)
at Object.Wo.(anonymous function) [as setStorageSync] ([publib]:8:7826)
at Object.
at Function.
at Object.
at success (weapp:///app.js:46:20)
at Function.function.a.(anonymous function) ([publib]:6:29081)
at Object.success ([publib]:4:4154)
at X.
getOpenId: function getOpenId(cb) { var that = this ; wx.hideShareMenu(); if ( this .globalData.openId) { this .log( this .globalData.openId, '缓存' ); cb( this .globalData.openId); } else { //调用登录接口 wx.login({ success: function success(res) { var code = res.code; that.log(code, '实时获取到的 code' ); //通过code换取openid wx.request({ url: that.globalData.remoteUrl + '/api/login' , data: { _ajax: 1, code: code }, method: 'POST' , header: {}, success: function success(res) { that.log( 'getOpenid' , res); if (res.data.code == 1) { that.globalData.openId = res.data.data.xcxopenid; wx.setStorageSync( 'openId' , res.data.data.xcxopenid);//报错代码位置 if (res.data.data.token) { wx.setStorageSync( 'token' , res.data.data.token); that.globalData.token = res.data.data.token; } that.log(that.globalData.openId, '实时获取到的 openid' ); cb(that.globalData.openId); } else { cb(); } }, fail: function fail(res) { that.wlanchaoshi(res); } }); } }); } }, |