加1,也是遇到了这个问题
开启远程调试时 经常报SDK:setStorageSync:fail这个错误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.([publib]:6:29338) at Function.([publib]:14:10718) at Object.([publib]:5:24761) at success (weapp:///app.js:46:20) at Function.function.a.(anonymous function) ([publib]:6:29081) at Object.success ([publib]:4:4154) at X.([publib]:6:24667) [代码]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);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]});[代码][代码] [代码][代码]}[代码][代码] [代码][代码]});[代码][代码] [代码][代码]}[代码][代码] [代码][代码]},[代码]
2018-08-27加1,也是遇到了这个问题 远程调试
开发者工具真机调试setStorageSync报错只要项目中使用了setStorageSync这个api,在真机调试的情况下就会报Error: APP-SERVICE-SDK:setStorageSync:fail Error: Failed To Send Sync,有时勾选“使用工具端的Storage”就好了,有时却不行
2018-08-27