AI助手支持GPT4.0
关于缓存getStorage的问题?Questions about caching getStorage?
关于缓存getStorage的问题?
明明没有通过wx.setStorage({})方法,设置key: "lemonKey",而直接通过 wx.getStorage({ key: "lemonKey",xxxx})方法获取值,为什么可以成功?
不使用wx.setStorage({}),而直接wx.getStorage({}),为啥能成功,求解
wx.getStorage({
key: "lemonKey",
success: function (res) {
t_point = res.data
},
fail: function () {
that.ds()
t_point = wx.getStorageSync( "lemonKey")
}
})
Clearly did not pass wx.setStorage ({}) method, set key: "lemonkey", and directly through the wx.getStorage ({key: "lemonkey", XXXX}) method to get the value, why can it succeed? Not used wx.setStorage ({}), but directly wx.getStorage ({}), why can we succeed, and how to solve it wx.getStorage ({ key: "lemonKey", success: function (res) { t_ point = res.data }, fail: function () { that.ds () t_ point = wx.getStorageSync ( "lemonKey") } })
看看这个,能帮你快速解决问题
https://developers.weixin.qq.com/community/develop/article/doc/0000e40e268e6886ace906d2451013