From 611d1a65e74e1148572cf01fe57a483ae59013b5 Mon Sep 17 00:00:00 2001 From: LiJinHui <166460433+stu-rgsze@users.noreply.github.com> Date: Fri, 19 Sep 2025 17:53:43 +0800 Subject: [PATCH] Update index.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 权限调整 --- main/manager-web/src/router/index.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/main/manager-web/src/router/index.js b/main/manager-web/src/router/index.js index b916e2f3..58cd099f 100644 --- a/main/manager-web/src/router/index.js +++ b/main/manager-web/src/router/index.js @@ -170,13 +170,10 @@ VueRouter.prototype.push = function push(location) { // 需要登录才能访问的路由 const protectedRoutes = ['home', 'RoleConfig', 'DeviceManagement', 'UserManagement', 'ModelConfig'] -// 需要管理员权限才能访问的路由 -const adminRoutes = ['TemplateQuickConfig', 'AgentTemplateManagement'] - // 路由守卫 router.beforeEach((to, from, next) => { // 检查是否是需要保护的路由 - if (protectedRoutes.includes(to.name) || adminRoutes.includes(to.name)) { + if (protectedRoutes.includes(to.name)) { // 从localStorage获取token const token = localStorage.getItem('token') if (!token) { @@ -184,16 +181,6 @@ router.beforeEach((to, from, next) => { next({ name: 'login', query: { redirect: to.fullPath } }) return } - - // 对于需要管理员权限的路由,检查用户是否是超级管理员 - if (adminRoutes.includes(to.name)) { - const isSuperAdmin = localStorage.getItem('isSuperAdmin') === 'true' - if (!isSuperAdmin) { - // 不是管理员,跳转到首页或显示无权限提示 - next({ name: 'home' }) - return - } - } } next() })