修复bug
This commit is contained in:
@@ -80,11 +80,8 @@ const tokenSave = uni.getStorageSync('token')
|
||||
const needRedirect = hasShowGuide || tokenSave
|
||||
|
||||
if (needRedirect) {
|
||||
if (tokenSave) {
|
||||
uni.reLaunch({ url: '/pages/index/index' })
|
||||
} else if (hasShowGuide) {
|
||||
uni.reLaunch({ url: '/pageSubPack/loginSub/login?mode=pwd' })
|
||||
}
|
||||
// 已登录或已看过引导页:直接进首页
|
||||
uni.reLaunch({ url: '/pages/index/index' })
|
||||
}
|
||||
|
||||
// ========== 响应式数据 ==========
|
||||
@@ -122,17 +119,10 @@ const handleBtnClick = () => {
|
||||
isNavigating.value = true;
|
||||
// 记录引导已完成
|
||||
uni.setStorageSync('hasShowGuide', true);
|
||||
// 检查是否已有登录 token,有则直接进首页,否则跳转登录页
|
||||
const token = uni.getStorageSync('token');
|
||||
if (token) {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pageSubPack/loginSub/login?mode=pwd"
|
||||
})
|
||||
}
|
||||
// 直接进入首页(未登录用户可正常浏览首页,需登录的功能由点击拦截处理)
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user