From fb69937cc5ca45dab3412636fdecdaf063156147 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期三, 13 八月 2025 16:57:50 +0800
Subject: [PATCH] 浪潮平台对接单点登录3
---
src/router/index.js | 49 ++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 40 insertions(+), 9 deletions(-)
diff --git a/src/router/index.js b/src/router/index.js
index 7bd960b..b37fa51 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -1,4 +1,5 @@
import { createWebHistory, createRouter } from 'vue-router'
+/* Layout */
import Layout from '@/layout'
/**
@@ -12,6 +13,8 @@
* redirect: noRedirect // 褰撹缃� noRedirect 鐨勬椂鍊欒璺敱鍦ㄩ潰鍖呭睉瀵艰埅涓笉鍙鐐瑰嚮
* name:'router-name' // 璁惧畾璺敱鐨勫悕瀛楋紝涓�瀹氳濉啓涓嶇劧浣跨敤<keep-alive>鏃朵細鍑虹幇鍚勭闂
* query: '{"id": 1, "name": "ry"}' // 璁块棶璺敱鐨勯粯璁や紶閫掑弬鏁�
+ * roles: ['admin', 'common'] // 璁块棶璺敱鐨勮鑹叉潈闄�
+ * permissions: ['a:a:a', 'b:b:b'] // 璁块棶璺敱鐨勮彍鍗曟潈闄�
* meta : {
noCache: true // 濡傛灉璁剧疆涓簍rue锛屽垯涓嶄細琚� <keep-alive> 缂撳瓨(榛樿 false)
title: 'title' // 璁剧疆璇ヨ矾鐢卞湪渚ц竟鏍忓拰闈㈠寘灞戜腑灞曠ず鐨勫悕瀛�
@@ -40,6 +43,11 @@
hidden: true
},
{
+ path: "/callbacklccpn",
+ component: () => import("@/views/tideLogin.vue"),
+ hidden: true,
+ },
+ {
path: '/register',
component: () => import('@/views/register'),
hidden: true
@@ -54,16 +62,31 @@
component: () => import('@/views/error/401'),
hidden: true
},
+
{
path: '',
component: Layout,
- redirect: 'index',
+ redirect: '/index',
children: [
{
path: '/index',
component: () => import('@/views/index'),
name: 'Index',
meta: { title: '棣栭〉', icon: 'dashboard', affix: true }
+ }
+ ]
+ },
+ {
+ path: '/main/MobileChat',
+ component: Layout,
+ redirect: '',
+ hidden: true,
+ children: [
+ {
+ path: '',
+ component: () => import('@/views/chatHome/chatHomeIndex/MobileChat'),
+ name: 'MobileChat',
+ meta: { title: 'AI瀵硅瘽', icon: 'dashboard', affix: true}
}
]
},
@@ -80,11 +103,16 @@
meta: { title: '涓汉涓績', icon: 'user' }
}
]
- },
+ }
+]
+
+// 鍔ㄦ�佽矾鐢憋紝鍩轰簬鐢ㄦ埛鏉冮檺鍔ㄦ�佸幓鍔犺浇
+export const dynamicRoutes = [
{
path: '/system/user-auth',
component: Layout,
hidden: true,
+ permissions: ['system:user:edit'],
children: [
{
path: 'role/:userId(\\d+)',
@@ -98,6 +126,7 @@
path: '/system/role-auth',
component: Layout,
hidden: true,
+ permissions: ['system:role:edit'],
children: [
{
path: 'user/:roleId(\\d+)',
@@ -111,6 +140,7 @@
path: '/system/dict-data',
component: Layout,
hidden: true,
+ permissions: ['system:dict:list'],
children: [
{
path: 'index/:dictId(\\d+)',
@@ -124,9 +154,10 @@
path: '/monitor/job-log',
component: Layout,
hidden: true,
+ permissions: ['monitor:job:list'],
children: [
{
- path: 'index',
+ path: 'index/:jobId(\\d+)',
component: () => import('@/views/monitor/job/log'),
name: 'JobLog',
meta: { title: '璋冨害鏃ュ織', activeMenu: '/monitor/job' }
@@ -137,16 +168,17 @@
path: '/tool/gen-edit',
component: Layout,
hidden: true,
+ permissions: ['tool:gen:edit'],
children: [
{
- path: 'index',
+ path: 'index/:tableId(\\d+)',
component: () => import('@/views/tool/gen/editTable'),
name: 'GenEdit',
meta: { title: '淇敼鐢熸垚閰嶇疆', activeMenu: '/tool/gen' }
}
]
}
-];
+]
const router = createRouter({
history: createWebHistory(),
@@ -154,10 +186,9 @@
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition
- } else {
- return { top: 0 }
}
+ return { top: 0 }
},
-});
+})
-export default router;
\ No newline at end of file
+export default router
--
Gitblit v1.9.3