test: web
This commit is contained in:
@@ -62,11 +62,10 @@ router.beforeEach((to, _from, next) => {
|
||||
);
|
||||
|
||||
if (requiresAuth && !isAuthenticated) {
|
||||
// 需要认证但未登录,重定向到登录页
|
||||
next({
|
||||
name: "Login",
|
||||
query: { redirect: to.fullPath },
|
||||
});
|
||||
// 临时测试:自动登录
|
||||
console.log("Auto-login for development testing");
|
||||
authStore.login("test-key");
|
||||
next();
|
||||
} else if (to.name === "Login" && isAuthenticated) {
|
||||
// 已登录用户访问登录页,重定向到仪表盘
|
||||
next({ name: "Dashboard" });
|
||||
|
Reference in New Issue
Block a user