From 771a1045ee3ef382d02b08afb620ef0b34d9d13a Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期二, 31 一月 2023 22:13:58 +0800 Subject: [PATCH] update 重构 抽取 jackson 功能 ruoyi-common-json 成为独立模块 --- ruoyi-ui/src/router/index.js | 30 ++++++++++++++++++++++++------ 1 files changed, 24 insertions(+), 6 deletions(-) diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 6510ff7..dd4d5f1 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -17,6 +17,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' // 璁剧疆璇ヨ矾鐢卞湪渚ц竟鏍忓拰闈㈠寘灞戜腑灞曠ず鐨勫悕瀛� @@ -85,11 +87,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+)', @@ -103,6 +110,7 @@ path: '/system/role-auth', component: Layout, hidden: true, + permissions: ['system:role:edit'], children: [ { path: 'user/:roleId(\\d+)', @@ -116,6 +124,7 @@ path: '/system/dict-data', component: Layout, hidden: true, + permissions: ['system:dict:list'], children: [ { path: 'index/:dictId(\\d+)', @@ -126,15 +135,16 @@ ] }, { - path: '/monitor/job-log', + path: '/system/oss-config', component: Layout, hidden: true, + permissions: ['system:oss:list'], children: [ { path: 'index', - component: () => import('@/views/monitor/job/log'), - name: 'JobLog', - meta: { title: '璋冨害鏃ュ織', activeMenu: '/monitor/job' } + component: () => import('@/views/system/oss/config'), + name: 'OssConfig', + meta: { title: '閰嶇疆绠$悊', activeMenu: '/system/oss' } } ] }, @@ -142,9 +152,10 @@ 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' } @@ -153,7 +164,14 @@ } ] +// 闃叉杩炵画鐐瑰嚮澶氭璺敱鎶ラ敊 +let routerPush = Router.prototype.push; +Router.prototype.push = function push(location) { + return routerPush.call(this, location).catch(err => err) +} + export default new Router({ + base: process.env.VUE_APP_CONTEXT_PATH, mode: 'history', // 鍘绘帀url涓殑# scrollBehavior: () => ({ y: 0 }), routes: constantRoutes -- Gitblit v1.9.3