web-权限、文章

This commit is contained in:
2025-10-18 18:19:19 +08:00
parent b3424e554f
commit ccc1d6338b
35 changed files with 3314 additions and 463 deletions

View File

@@ -216,11 +216,11 @@ const authModule: Module<AuthState, any> = {
// 清除认证信息
commit('CLEAR_AUTH');
// 跳转到登录页(必须在重置路由之前)
await router.push('/login');
// 重置路由
resetRouter();
// 跳转到登录页
router.push('/login');
}
},
@@ -279,6 +279,14 @@ const authModule: Module<AuthState, any> = {
router.addRoute(route);
});
// 添加404路由必须在所有动态路由之后
// 只有登录后才会添加这个路由,未登录会跳转到登录页
router.addRoute({
path: "/:pathMatch(.*)*",
name: 'NotFoundAfterLogin',
redirect: "/404",
});
// 标记路由已加载
commit('SET_ROUTES_LOADED', true);