登录跳转
This commit is contained in:
parent
873ecb949b
commit
16b4af7942
@ -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
|
||||||
});
|
});
|
||||||
|
|||||||
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user