登录跳转

This commit is contained in:
aihe 2024-02-28 17:48:44 +08:00
parent 873ecb949b
commit 16b4af7942
3 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ const goto = (url, type = 1)=> {
uni.navigateTo({ uni.navigateTo({
url url
}); });
} else { } else if (type == 2){
uni.redirectTo({ uni.redirectTo({
url url
}); });

View File

@ -154,7 +154,7 @@
goto, goto,
async handleUnlogin() { async handleUnlogin() {
await this.$store.dispatch(USERKEY.LOGOUT) await this.$store.dispatch(USERKEY.LOGOUT)
goto(`login/login`) goto(`login/login`, 2)
} }
} }
} }

View File

@ -66,7 +66,7 @@ export default {
rootState rootState
}, options) { }, options) {
if(!state.token) { if(!state.token) {
goto("login/login", 1) goto("login/login", 2)
throw new Error('缺少token') throw new Error('缺少token')
} }