From b9f45057b8bac74d6c6997e698cbb814a097990a Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期三, 10 八月 2022 18:01:02 +0800
Subject: [PATCH] 操作日志记录支持排除敏感属性字段
---
ruoyi-ui/src/router/index.js | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js
index 6510ff7..0ef9d70 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 // 如果设置为true,则不会被 <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+)',
@@ -129,6 +138,7 @@
path: '/monitor/job-log',
component: Layout,
hidden: true,
+ permissions: ['monitor:job:list'],
children: [
{
path: 'index',
@@ -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,6 +164,12 @@
}
]
+// 防止连续点击多次路由报错
+let routerPush = Router.prototype.push;
+Router.prototype.push = function push(location) {
+ return routerPush.call(this, location).catch(err => err)
+}
+
export default new Router({
mode: 'history', // 去掉url中的#
scrollBehavior: () => ({ y: 0 }),
--
Gitblit v1.9.2