微信小程序 什么时候会清除数据缓存?

小程序 文章 2021-01-25 18:01 620 0 全屏看文

AI助手支持GPT4.0

微信小程序 什么时候会清除数据缓存?When will the WeChat applet clear the data cache?

微信小程序 什么时候会清除数据缓存?

什么时候会只清除数据缓存而不清除登陆状态?

因为登陆状态不清除的话,点击登录获取的iv和encryptedData和服务端返回的session_key会出现用RdWXBizDataCrypt无法解析出内容


When will only the data cache be cleared without clearing the login status? If the login status is not cleared, click the IV and encrypted data obtained by login and the session returned by the server_ The key will appear, and the content cannot be parsed by rdwxbizdatacrypt

回答:

小黎:

建议每次解密前先wx.login ,保证解密key和加密key是一样的https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html

野生奥特曼:

没法主动清除的。

brave:

https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.checkSession.html

登录态会过期的,通过 wx.checkSession 判断登录态,重新调用 wx.login 进行登录。

-EOF-

AI助手支持GPT4.0