From b9752b9a51a338c077d45e3c54f550ed934bdc4d Mon Sep 17 00:00:00 2001 From: zyh Date: Thu, 28 Aug 2025 21:26:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=B7=AF=E7=94=B1=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E5=90=88=E5=B9=B6=E7=94=A8=E6=88=B7=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91=EF=BC=8C=E7=AE=80?= =?UTF-8?q?=E5=8C=96=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84=EF=BC=8C=E6=8F=90?= =?UTF-8?q?=E5=8D=87=E5=8F=AF=E8=AF=BB=E6=80=A7=E5=92=8C=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E6=80=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index aeed167..48b6f97 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,6 +1,6 @@ import { createRouter, createWebHistory } from 'vue-router' import { isLoggedIn } from '@/utils/auth' -import { canAccessRoute } from '@/utils/permission' +import { canAccessRoute, getCurrentUserType } from '@/utils/permission' const AdminLayout = () => import('@/layouts/AdminLayout.vue') const Login = () => import('@/views/Login.vue') @@ -24,7 +24,6 @@ export const routes = [ path: '', redirect: (to) => { // 根据用户类型重定向到不同的默认页面 - const { getCurrentUserType } = require('@/utils/permission') const userType = getCurrentUserType() if (userType?.toLowerCase() === 'agent') { @@ -58,7 +57,6 @@ router.beforeEach((to, from, next) => { // 检查路由权限 if (to.name && !canAccessRoute(to.name)) { // 根据用户类型跳转到有权限的默认页面 - const { getCurrentUserType } = require('@/utils/permission') const userType = getCurrentUserType() if (userType?.toLowerCase() === 'agent') {