收藏
回答

APP-SERVICE-SDK:setStorageSync:fail writ

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug wx.setStorageSync() 客户端 7.0.3 未知

问题:

微信公众平台的运营中心错误查询 有很多次报错 APP-SERVICE-SDK:setStorageSync:fail,请问这是什么原因呢?

错误:

APP-SERVICE-SDK:setStorageSync:fail write DB data fail;at App getUserSystemInfo function construct@[native code] rt@https://lib/WAService.js:1:281340 n@https://lib/WAService.js:1:281702 n@https://lib/WAService.js:1:493361 setStorageSync@https://lib/WAService.js:1:494351 https://lib/WAService.js:1:495735 https://lib/WAService.js:1:496335 https://lib/WAService.js:1:323260 https://lib/WAService.js:1:712493 https://lib/WAService.js:1:712589 https://lib/WAService.js:1:281981 getUserSystemInfo@https://app.js:183:8 https://lib/WAService.js:1:942569 wxFirst@https://app.js:194:10 https://lib/WAService.js:1:942569 success@https://app.js:144:16 https://lib/WAService.js:1:712307 https://lib/WAService.js:1:101845 g@https://lib/WAService.js:1:276440 We@https://lib/WAService.js:1:276615 https://lib/WAService.js:1:278067 y@https://lib/WAService.js:1:1377 https://lib/WAService.js:1:1121 _@https://lib/WAService.js:1:1287 invoke@https://lib/WAService.js:1:117378 X@https://lib/WAService.js:1:270517 https://lib/WAService.js:1:278048 Fr@https://lib/WAService.js:1:362044 https://lib/WAService.js:1:323260 https://lib/WAService.js:1:712493 https://lib/WAService.js:1:712589 https://lib/WAService.js:1:281981 handleVersion@https://app.js:133:8 https://lib/WAService.js:1:942569 onLaunch@https://app.js:88:10 https://lib/WAService.js:1:942010 e@https://lib/WAService.js:1:942896 https://lib/WAService.js:1:943086 https://lib/WAService.js:1:931969 https://app.js:8:1 require@https://lib/WAService.js:1:971779 global code@https://usr/app-service.js:3311:17


所涉及到的代码:

// 获取用户设备信息
 getUserSystemInfo() {
   let ISIPHONEX_ETC = false;
   let deviceBrand = '';
   try {
     let res = wx.getSystemInfoSync();
     let brand = res.brand;
     let model = res.model;
 
     deviceBrand = brand;
     // iPhone X 及以上机型兼容
     if (brand == 'iPhone' || brand == 'devtools') {
       if (brand == 'devtools' && model == 'iPhone X') {
         model = 'unknown<iPhone10,6>';
       }
       if (model.search('unknown') != -1) {
         let strStart = model.indexOf('<');
         let strEnd = model.indexOf(',');
         model = model.substring(strStart, strEnd).split('<iPhone')[1] * 1;
         ISIPHONEX_ETC = model > 9 ? true : false;
       } else {
         ISIPHONEX_ETC = model.search('iPhone X') != -1 ? true : false;
       }
     }
   } catch (e) {
     console.log(e);
   }
   wx.setStorageSync('systemInfo', {
     ISIPHONEX_ETC,
     ISIPHONEX_NUM: 53,
     brand: deviceBrand
   });
 }


回答关注问题邀请回答
收藏

5 个回答

登录 后发表内容