优化代码

This commit is contained in:
TOP糯米 2023-04-08 00:34:56 +08:00
parent e97965f15c
commit 983e7d85c0
1 changed files with 10 additions and 1 deletions

View File

@ -4,8 +4,17 @@ export default {
pageConfig: {}, pageConfig: {},
}, },
onLaunch: async function () { onLaunch: async function () {
let that = this;
for (let method of ["navigateTo", "redirectTo", "reLaunch", "switchTab", "navigateBack"]) {
uni.addInterceptor(method, {
success() {
that.$store.commit("toast/show", false);
that.$store.commit("toast/title", "");
},
});
}
let pageConfig = this.$storage.get("system_config"); let pageConfig = this.$storage.get("system_config");
if (true) { if (!pageConfig) {
const { windowWidth, windowHeight, statusBarHeight, safeAreaInsets } = uni.getSystemInfoSync(); const { windowWidth, windowHeight, statusBarHeight, safeAreaInsets } = uni.getSystemInfoSync();
// #ifndef H5 // #ifndef H5
const { height, top } = uni.getMenuButtonBoundingClientRect(); const { height, top } = uni.getMenuButtonBoundingClientRect();