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') {