修复小程序无法进入的bug

This commit is contained in:
weipengfei 2023-11-11 09:44:23 +08:00
parent 5cc0cf983c
commit f44c5e1268
2 changed files with 19 additions and 9 deletions

24
App.vue
View File

@ -37,7 +37,7 @@
shop_token: info.referrerInfo?.extraData?.token shop_token: info.referrerInfo?.extraData?.token
}); });
this.$store.commit('SET_USERINFO', { this.$store.commit('SET_USERINFO', {
user: data, user: {},
token: res.data.token token: res.data.token
}) })
this.$store.dispatch('initConfig'); this.$store.dispatch('initConfig');
@ -45,17 +45,15 @@
data data
} = await userInfo(); } = await userInfo();
this.$store.commit('setUserInfo', data); this.$store.commit('setUserInfo', data);
this.$isResolve() // this.$isResolve()
// uni.$emit('home_initUserInfo', data); // uni.$emit('home_initUserInfo', data);
return; // return;
} catch (e) { } catch (e) {
this.$isResolve() // this.$isResolve()
console.log(e); console.log(e);
} }
} }
console.log('App Launch') console.log('App Launch')
this.$store.dispatch('initConfig');
this.$isResolve()
try { try {
if (!this.$store.state.app.token) uni.reLaunch({ if (!this.$store.state.app.token) uni.reLaunch({
url: '/pages/oaLogin/oaLogin', url: '/pages/oaLogin/oaLogin',
@ -63,16 +61,28 @@
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.navigator.closeSplashscreen(); // plus.navigator.closeSplashscreen(); //
// #endif // #endif
this.$isResolve()
} }
}) })
else { else {
this.$store.dispatch('initConfig');
this.$isResolve()
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.navigator.closeSplashscreen(); // plus.navigator.closeSplashscreen(); //
// #endif // #endif
} }
} catch (e) { } catch (e) {
this.$isResolve()
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.navigator.closeSplashscreen(); // uni.reLaunch({
url: '/pages/oaLogin/oaLogin',
success() {
// #ifdef APP-PLUS
plus.navigator.closeSplashscreen(); //
// #endif
this.$isResolve()
}
})
// #endif // #endif
} }
}, },

View File

@ -3,8 +3,8 @@
// "appid" : "__UNI__3A527D1", // "appid" : "__UNI__3A527D1",
"appid" : "__UNI__B5B1EDD", "appid" : "__UNI__B5B1EDD",
"description" : "", "description" : "",
"versionName" : "1.2.5", "versionName" : "1.2.7",
"versionCode" : 125, "versionCode" : 127,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {