From 3fb8f1c2516f8e56ec9406426ccb4764c6c50968 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期日, 02 七月 2023 15:32:58 +0800
Subject: [PATCH] 回退 'Pull Request !20 : 统一登录授权'
---
src/router/index.ts | 276 +++++++++++++++++++++++++++---------------------------
1 files changed, 138 insertions(+), 138 deletions(-)
diff --git a/src/router/index.ts b/src/router/index.ts
index 5c5388c..9540ab2 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -26,154 +26,154 @@
// 鍏叡璺敱
export const constantRoutes: RouteOption[] = [
- {
- path: '/redirect',
- component: Layout,
- hidden: true,
- children: [
- {
- path: '/redirect/:path(.*)',
- component: () => import('@/views/redirect/index.vue')
- }
- ]
- },
- {
- path: '/login',
- component: () => import('@/views/login.vue'),
- hidden: true
- },
- {
- path: '/register',
- component: () => import('@/views/register.vue'),
- hidden: true
- },
- {
- path: '/:pathMatch(.*)*',
- component: () => import('@/views/error/404.vue'),
- hidden: true
- },
- {
- path: '/401',
- component: () => import('@/views/error/401.vue'),
- hidden: true
- },
- {
- path: '',
- component: Layout,
- redirect: '/index',
- children: [
- {
- path: '/index',
- component: () => import('@/views/index.vue'),
- name: 'Index',
- meta: { title: '棣栭〉', icon: 'dashboard', affix: true }
- }
- ]
- },
- {
- path: '/user',
- component: Layout,
- hidden: true,
- redirect: 'noredirect',
- children: [
- {
- path: 'profile',
- component: () => import('@/views/system/user/profile/index.vue'),
- name: 'Profile',
- meta: { title: '涓汉涓績', icon: 'user' }
- }
- ]
- }
+ {
+ path: '/redirect',
+ component: Layout,
+ hidden: true,
+ children: [
+ {
+ path: '/redirect/:path(.*)',
+ component: () => import('@/views/redirect/index.vue')
+ }
+ ]
+ },
+ {
+ path: '/login',
+ component: () => import('@/views/login.vue'),
+ hidden: true
+ },
+ {
+ path: '/register',
+ component: () => import('@/views/register.vue'),
+ hidden: true
+ },
+ {
+ path: '/:pathMatch(.*)*',
+ component: () => import('@/views/error/404.vue'),
+ hidden: true
+ },
+ {
+ path: '/401',
+ component: () => import('@/views/error/401.vue'),
+ hidden: true
+ },
+ {
+ path: '',
+ component: Layout,
+ redirect: '/index',
+ children: [
+ {
+ path: '/index',
+ component: () => import('@/views/index.vue'),
+ name: 'Index',
+ meta: { title: '棣栭〉', icon: 'dashboard', affix: true }
+ }
+ ]
+ },
+ {
+ path: '/user',
+ component: Layout,
+ hidden: true,
+ redirect: 'noredirect',
+ children: [
+ {
+ path: 'profile',
+ component: () => import('@/views/system/user/profile/index.vue'),
+ name: 'Profile',
+ meta: { title: '涓汉涓績', icon: 'user' }
+ }
+ ]
+ }
];
// 鍔ㄦ�佽矾鐢憋紝鍩轰簬鐢ㄦ埛鏉冮檺鍔ㄦ�佸幓鍔犺浇
export const dynamicRoutes: RouteOption[] = [
- {
- path: '/system/user-auth',
- component: Layout,
- hidden: true,
- permissions: ['system:user:edit'],
- children: [
- {
- path: 'role/:userId(\\d+)',
- component: () => import('@/views/system/user/authRole.vue'),
- name: 'AuthRole',
- meta: { title: '鍒嗛厤瑙掕壊', activeMenu: '/system/user', icon: '' }
- }
- ]
- },
- {
- path: '/system/role-auth',
- component: Layout,
- hidden: true,
- permissions: ['system:role:edit'],
- children: [
- {
- path: 'user/:roleId(\\d+)',
- component: () => import('@/views/system/role/authUser.vue'),
- name: 'AuthUser',
- meta: { title: '鍒嗛厤鐢ㄦ埛', activeMenu: '/system/role', icon: '' }
- }
- ]
- },
- {
- path: '/system/dict-data',
- component: Layout,
- hidden: true,
- permissions: ['system:dict:list'],
- children: [
- {
- path: 'index/:dictId(\\d+)',
- component: () => import('@/views/system/dict/data.vue'),
- name: 'Data',
- meta: { title: '瀛楀吀鏁版嵁', activeMenu: '/system/dict', icon: '' }
- }
- ]
- },
- {
- path: '/system/oss-config',
- component: Layout,
- hidden: true,
- permissions: ['monitor:job:list'],
- children: [
- {
- path: 'index',
- component: () => import('@/views/system/oss/config.vue'),
- name: 'OssConfig',
- meta: { title: '閰嶇疆绠$悊', activeMenu: '/system/oss', icon: '' }
- }
- ]
- },
- {
- path: '/tool/gen-edit',
- component: Layout,
- hidden: true,
- permissions: ['tool:gen:edit'],
- children: [
- {
- path: 'index/:tableId(\\d+)',
- component: () => import('@/views/tool/gen/editTable.vue'),
- name: 'GenEdit',
- meta: { title: '淇敼鐢熸垚閰嶇疆', activeMenu: '/tool/gen', icon: '' }
- }
- ]
- }
+ {
+ path: '/system/user-auth',
+ component: Layout,
+ hidden: true,
+ permissions: ['system:user:edit'],
+ children: [
+ {
+ path: 'role/:userId(\\d+)',
+ component: () => import('@/views/system/user/authRole.vue'),
+ name: 'AuthRole',
+ meta: { title: '鍒嗛厤瑙掕壊', activeMenu: '/system/user', icon: '' }
+ }
+ ]
+ },
+ {
+ path: '/system/role-auth',
+ component: Layout,
+ hidden: true,
+ permissions: ['system:role:edit'],
+ children: [
+ {
+ path: 'user/:roleId(\\d+)',
+ component: () => import('@/views/system/role/authUser.vue'),
+ name: 'AuthUser',
+ meta: { title: '鍒嗛厤鐢ㄦ埛', activeMenu: '/system/role', icon: '' }
+ }
+ ]
+ },
+ {
+ path: '/system/dict-data',
+ component: Layout,
+ hidden: true,
+ permissions: ['system:dict:list'],
+ children: [
+ {
+ path: 'index/:dictId(\\d+)',
+ component: () => import('@/views/system/dict/data.vue'),
+ name: 'Data',
+ meta: { title: '瀛楀吀鏁版嵁', activeMenu: '/system/dict', icon: '' }
+ }
+ ]
+ },
+ {
+ path: '/system/oss-config',
+ component: Layout,
+ hidden: true,
+ permissions: ['system:oss:list'],
+ children: [
+ {
+ path: 'index',
+ component: () => import('@/views/system/oss/config.vue'),
+ name: 'OssConfig',
+ meta: { title: '閰嶇疆绠$悊', activeMenu: '/system/oss', icon: '' }
+ }
+ ]
+ },
+ {
+ path: '/tool/gen-edit',
+ component: Layout,
+ hidden: true,
+ permissions: ['tool:gen:edit'],
+ children: [
+ {
+ path: 'index/:tableId(\\d+)',
+ component: () => import('@/views/tool/gen/editTable.vue'),
+ name: 'GenEdit',
+ meta: { title: '淇敼鐢熸垚閰嶇疆', activeMenu: '/tool/gen', icon: '' }
+ }
+ ]
+ }
];
/**
* 鍒涘缓璺敱
*/
const router = createRouter({
- history: createWebHistory(import.meta.env.VITE_APP_CONTEXT_PATH),
- routes: constantRoutes,
- // 鍒锋柊鏃讹紝婊氬姩鏉′綅缃繕鍘�
- scrollBehavior(to, from, savedPosition) {
- if (savedPosition) {
- return savedPosition;
- } else {
- return { top: 0 };
- }
- }
+ history: createWebHistory(import.meta.env.VITE_APP_CONTEXT_PATH),
+ routes: constantRoutes,
+ // 鍒锋柊鏃讹紝婊氬姩鏉′綅缃繕鍘�
+ scrollBehavior(to, from, savedPosition) {
+ if (savedPosition) {
+ return savedPosition;
+ } else {
+ return { top: 0 };
+ }
+ }
});
export default router;
--
Gitblit v1.9.3