优化公众端登录状态无法保存的问题

This commit is contained in:
En 2026-04-09 21:32:53 +08:00
parent f1d40db322
commit b94c34bf60

View File

@ -492,6 +492,16 @@ router.beforeEach(async (to, _from, next) => {
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 tenantCodeFromUrl = extractTenantCodeFromPath(to.path)