优化
This commit is contained in:
11
unpackage/dist/dev/mp-weixin/pages/Home/Home.js
vendored
11
unpackage/dist/dev/mp-weixin/pages/Home/Home.js
vendored
@@ -76,6 +76,7 @@ const _sfc_main = {
|
||||
this.pkList({ type: 1 });
|
||||
},
|
||||
onLoad() {
|
||||
this.AutomaticCleaning();
|
||||
common_vendor.index.getStorage({
|
||||
key: "userinfo",
|
||||
success: (res) => {
|
||||
@@ -98,6 +99,16 @@ const _sfc_main = {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
//自动清理
|
||||
AutomaticCleaning() {
|
||||
const lastCleanTime = common_vendor.index.getStorageSync("last_clean_time") || 0;
|
||||
const now = Date.now();
|
||||
if (now - lastCleanTime < 7 * 24 * 3600 * 1e3)
|
||||
return;
|
||||
common_vendor.index.clearStorage();
|
||||
common_vendor.A.logout();
|
||||
common_vendor.index.setStorageSync("last_clean_time", now);
|
||||
},
|
||||
//关闭弹窗(取消)
|
||||
closePopup() {
|
||||
this.$refs.popup.close();
|
||||
|
||||
Reference in New Issue
Block a user