优化公众端登录状态无法保存的问题
This commit is contained in:
parent
f1d40db322
commit
b94c34bf60
@ -492,6 +492,16 @@ router.beforeEach(async (to, _from, next) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根路径:检查公众端登录状态,已登录则跳转活动大厅,未登录则跳转公众端登录页
|
||||||
|
if (to.path === "/") {
|
||||||
|
if (localStorage.getItem("public_token")) {
|
||||||
|
next({ path: "/p/activities", replace: true })
|
||||||
|
} else {
|
||||||
|
next({ path: "/p/login", replace: true })
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const tenantCodeFromUrl = extractTenantCodeFromPath(to.path)
|
const tenantCodeFromUrl = extractTenantCodeFromPath(to.path)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user