优化页面
This commit is contained in:
14
unpackage/dist/dev/mp-weixin/app.js
vendored
14
unpackage/dist/dev/mp-weixin/app.js
vendored
@@ -8,10 +8,12 @@ if (!Math) {
|
||||
"./pages/Mine/minecomponents/contact.js";
|
||||
"./pages/Mine/minecomponents/pkInformation.js";
|
||||
"./pages/Mine/minecomponents/recompose/recompose.js";
|
||||
"./pages/Mine/minecomponents/serviceProtocol.js";
|
||||
"./pages/Mine/minecomponents/DetailsPKRecords/DetailsPKRecords.js";
|
||||
"./pages/PKMessageprocessing/PKMessageprocessing.js";
|
||||
"./pages/index/index.js";
|
||||
"./pages/login/login.js";
|
||||
"./pages/Forum/Forum.js";
|
||||
"./pages/UserInformation/UserInformation.js";
|
||||
"./pages/Setting/Setting.js";
|
||||
"./pages/NewAddedPk/NewAddedPk.js";
|
||||
@@ -34,6 +36,7 @@ const _sfc_main = {
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
AutomaticCleaning();
|
||||
common_vendor.index.getStorage({
|
||||
key: "userinfo",
|
||||
success: (res) => {
|
||||
@@ -44,6 +47,17 @@ 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.index.setStorageSync("last_clean_time", now);
|
||||
}
|
||||
},
|
||||
provide() {
|
||||
return {
|
||||
$global: {
|
||||
|
||||
Reference in New Issue
Block a user