优化
This commit is contained in:
22
unpackage/dist/dev/mp-weixin/app.js
vendored
22
unpackage/dist/dev/mp-weixin/app.js
vendored
@@ -38,28 +38,8 @@ const _sfc_main = {
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.AutomaticCleaning();
|
||||
common_vendor.index.getStorage({
|
||||
key: "userinfo",
|
||||
success: (res) => {
|
||||
this.info = res.data;
|
||||
counter.$patch({ myitem: this.info });
|
||||
},
|
||||
fail: () => {
|
||||
}
|
||||
});
|
||||
},
|
||||
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.index.setStorageSync("last_clean_time", now);
|
||||
}
|
||||
},
|
||||
methods: {},
|
||||
provide() {
|
||||
return {
|
||||
$global: {
|
||||
|
||||
Reference in New Issue
Block a user