为什么request请求回数据后wx.setStorageSync报错无法使用将数据放入缓存?

小程序 文章 2022-02-09 09:40 353 0 全屏看文

AI助手支持GPT4.0

为什么request请求回数据后wx.setStorageSync报错无法使用将数据放入缓存?Why does wx.setStorageSync report an error and cannot use the data to put the data in the cache after the request requests the data back?

为什么request请求回数据后wx.setStorageSync报错无法使用将数据放入缓存?

小程序request请求回数据后,.then后想保存到小程序缓存,使用wx.setStorageSync却报错,说wx.setStorageSync不是一个函数。请问打大家是怎么把请求回来的数据放到缓存里的。下面是我的代码


After the applet requests data back After then, if you want to save to the applet cache, use Wx Storagesync.setwx is wrong Setstoragesync is not a function. How do you put the requested data into the cache. Here is my code

回答:

小黎:

换个基础版本库,清除缓存重启一下

15:

应该就是基础库版本的问题了

|G.XIAO|:

你在试试,我们就用 setStorage,这个是微信小程序支持的API,你看看基础库版本是多少

-EOF-

AI助手支持GPT4.0