收藏
回答

getImageInfo里面不能再调用wx.setStorageSync??

thirdScriptError
APP-SERVICE-SDK:setStorageSync:fail Error: Failed To Send Sync;at api getImageInfo success callback function
Error: APP-SERVICE-SDK:setStorageSync:fail Error: Failed To Send Sync
    at setStorageSync ([publib]:1:538903)
    at r.(anonymous function) ([publib]:1:540581)
    at Object._l.(anonymous function) [as setStorageSync] ([publib]:1:541205)
    at Object.<anonymous> ([publib]:1:237550)
    at Object.<anonymous> ([publib]:1:778406)
    at Function.<anonymous> ([publib]:1:778536)
    at Object.<anonymous> ([publib]:1:228296)
    at success (weapp:///app.js:45:14)
    at Function.function.o.(anonymous function) ([publib]:1:777764)
    at Object.success ([publib]:1:101980)


我想在程序启动时下载一个图片,然后缓存在本地,下次启动不用重复下载

调用了wx.getImageInfo方法,然后在success中想通过wx.setStirageSync以网络图片地址为key,下载好的res.path为value,存一个缓存

但是真机调试确报了这个错,是为什么??如何在本地缓存一张图片呢?

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

2 个回答

登录 后发表内容