fix(登录): 添加已登录检查避免重复登录
当用户已登录时直接返回上一页,不再执行登录操作 同时启用路由拦截器的调试日志
This commit is contained in:
@@ -27,6 +27,10 @@ onLoad((options) => {
|
||||
const userStore = useUserStore()
|
||||
const tokenStore = useTokenStore()
|
||||
function doLogin() {
|
||||
if (tokenStore.hasLogin) {
|
||||
uni.navigateBack()
|
||||
return
|
||||
}
|
||||
userStore.setUserInfo({
|
||||
userId: 123456,
|
||||
username: 'abc123456',
|
||||
|
||||
Reference in New Issue
Block a user