缓存(默认 false)
+ title: 'title' // 【重要】设置该路由在侧边栏和面包屑中展示的名字
+ icon: 'svg-name' // 【重要】设置该路由的图标,对应路径 src/assets/icons/svg
+ breadcrumb: false // 如果设置为 false,则不会在 breadcrumb 面包屑中显示
activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。
}
*/
diff --git a/yudao-ui-admin/src/store/modules/permission.js b/yudao-ui-admin/src/store/modules/permission.js
index 4ddd9d2ac..caf99d59f 100644
--- a/yudao-ui-admin/src/store/modules/permission.js
+++ b/yudao-ui-admin/src/store/modules/permission.js
@@ -8,7 +8,8 @@ const permission = {
state: {
routes: [],
addRoutes: [],
- sidebarRouters: []
+ sidebarRouters: [], // 左侧边菜单的路由,被 Sidebar/index.vue 使用
+ topbarRouters: [], // 顶部菜单的路由,被 TopNav/index.vue 使用
},
mutations: {
SET_ROUTES: (state, routes) => {
@@ -29,10 +30,10 @@ const permission = {
// 生成路由
GenerateRoutes({ commit }) {
return new Promise(resolve => {
- // 向后端请求路由数据
+ // 向后端请求路由数据(菜单)
getRouters().then(res => {
- const sdata = JSON.parse(JSON.stringify(res.data))
- const rdata = JSON.parse(JSON.stringify(res.data))
+ const sdata = JSON.parse(JSON.stringify(res.data)) // 【重要】用于菜单中的数据
+ const rdata = JSON.parse(JSON.stringify(res.data)) // 用于最后添加到 Router 中的数据
const sidebarRoutes = filterAsyncRouter(sdata)
const rewriteRoutes = filterAsyncRouter(rdata, false, true)
rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
@@ -57,7 +58,7 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
icon: route.icon,
noCache: !route.keepAlive,
}
- // 路由地址转首字母大写驼峰,作为路由名称,适配keepAlive
+ // 路由地址转首字母大写驼峰,作为路由名称,适配 keepAlive
route.name = toCamelCase(route.path, true)
route.hidden = !route.visible
// 处理 component 属性
diff --git a/yudao-ui-admin/src/views/bpm/group/index.vue b/yudao-ui-admin/src/views/bpm/group/index.vue
index 775aecda1..c280179da 100644
--- a/yudao-ui-admin/src/views/bpm/group/index.vue
+++ b/yudao-ui-admin/src/views/bpm/group/index.vue
@@ -127,7 +127,6 @@ export default {
pageSize: 10,
name: null,
status: null,
- tenantId: null,
createTime: []
},
// 表单参数
diff --git a/yudao-ui-admin/src/views/login.vue b/yudao-ui-admin/src/views/login.vue
index 1024577b6..3055cd168 100644
--- a/yudao-ui-admin/src/views/login.vue
+++ b/yudao-ui-admin/src/views/login.vue
@@ -190,7 +190,7 @@ export default {
// 验证码开关
this.captchaEnable = getCaptchaEnable();
// 重定向地址
- this.redirect = this.$route.query.redirect;
+ this.redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : undefined;
this.getCookie();
},
methods: {
diff --git a/yudao-ui-admin/src/views/socialLogin.vue b/yudao-ui-admin/src/views/socialLogin.vue
index d3463ad66..0dc1abef7 100644
--- a/yudao-ui-admin/src/views/socialLogin.vue
+++ b/yudao-ui-admin/src/views/socialLogin.vue
@@ -117,7 +117,7 @@ export default {
// 验证码开关
this.captchaEnable = getCaptchaEnable();
// 重定向地址
- this.redirect = this.$route.query.redirect;
+ this.redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : undefined;
// 社交登录相关
this.type = this.$route.query.type;
this.code = this.$route.query.code;
diff --git a/yudao-ui-admin/src/views/sso.vue b/yudao-ui-admin/src/views/sso.vue
index 2a21e0af9..c1d0e1138 100644
--- a/yudao-ui-admin/src/views/sso.vue
+++ b/yudao-ui-admin/src/views/sso.vue
@@ -19,12 +19,7 @@
-
-
-
-
-
-
+
此第三方应用请求获得以下权限:
@@ -56,18 +51,13 @@