From f1299856fbd21edc531c58dc7f2f137d7575dd38 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 11 Jun 2021 12:53:22 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=9B=E7=BA=A7?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 2 +- src/store/modules/permission.js | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 7410141..47be649 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -56,7 +56,7 @@ export const loadMenus = (next, to) => { const sdata = JSON.parse(JSON.stringify(res)) const rdata = JSON.parse(JSON.stringify(res)) const sidebarRoutes = filterAsyncRouter(sdata) - const rewriteRoutes = filterAsyncRouter(rdata, true) + const rewriteRoutes = filterAsyncRouter(rdata, false, true) rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true }) store.dispatch('GenerateRoutes', rewriteRoutes).then(() => { // 存储路由 diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 49e4778..513e259 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -27,9 +27,9 @@ const permission = { } } -export const filterAsyncRouter = (routers, isRewrite = false) => { // 遍历后台传来的路由字符串,转换为组件对象 +export const filterAsyncRouter = (routers, lastRouter = false, type = false) => { // 遍历后台传来的路由字符串,转换为组件对象 return routers.filter(router => { - if (isRewrite && router.children) { + if (type && router.children) { router.children = filterChildren(router.children) } if (router.component) { @@ -42,14 +42,17 @@ export const filterAsyncRouter = (routers, isRewrite = false) => { // 遍历后 router.component = loadView(component) } } - if (router.children && router.children.length) { - router.children = filterAsyncRouter(router.children, router, isRewrite) + if (router.children != null && router.children && router.children.length) { + router.children = filterAsyncRouter(router.children, router, type) + } else { + delete router['children'] + delete router['redirect'] } return true }) } -function filterChildren(childrenMap) { +function filterChildren(childrenMap, lastRouter = false) { var children = [] childrenMap.forEach((el, index) => { if (el.children && el.children.length) { @@ -65,6 +68,9 @@ function filterChildren(childrenMap) { return } } + if (lastRouter) { + el.path = lastRouter.path + '/' + el.path + } children = children.concat(el) }) return children From a044049c07a43852eb32c5b654d37d43a434ae1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=B0=8F=E7=8B=BC=E7=8B=88?= <258392906@qq.com> Date: Sat, 4 Sep 2021 16:45:12 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=AE=89=E5=85=A8=E8=B5=B7=E8=A7=81,?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E4=B8=8D=E8=A6=81=E5=AD=98=E5=82=A8?= =?UTF-8?q?RSA=E7=9A=84=E7=A7=81=E9=92=A5=20(#115)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/rsaEncrypt.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/utils/rsaEncrypt.js b/src/utils/rsaEncrypt.js index d2dd553..1948ddd 100644 --- a/src/utils/rsaEncrypt.js +++ b/src/utils/rsaEncrypt.js @@ -5,15 +5,6 @@ import JSEncrypt from 'jsencrypt/bin/jsencrypt.min' const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANL378k3RiZHWx5AfJqdH9xRNBmD9wGD\n' + '2iRe41HdTNF8RUhNnHit5NpMNtGL0NPTSSpPjjI1kJfVorRvaQerUgkCAwEAAQ==' -const privateKey = 'MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8\n' + - 'mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9p\n' + - 'B6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue\n' + - '/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZ\n' + - 'UBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6\n' + - 'vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha\n' + - '4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3\n' + - 'tTbklZkD2A==' - // 加密 export function encrypt(txt) { const encryptor = new JSEncrypt() @@ -21,10 +12,3 @@ export function encrypt(txt) { return encryptor.encrypt(txt) // 对需要加密的数据进行加密 } -// 解密 -export function decrypt(txt) { - const encryptor = new JSEncrypt() - encryptor.setPrivateKey(privateKey) - return encryptor.decrypt(txt) -} - From 2a6e2feead72a3324e331e94f3e7e5350363c7fb Mon Sep 17 00:00:00 2001 From: Zheng Jie <201507802@qq.com> Date: Tue, 16 Nov 2021 21:26:47 +0800 Subject: [PATCH 3/3] close https://github.com/elunez/eladmin/issues/645 --- src/views/components/Editor.vue | 2 +- src/views/components/MarkDown.vue | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/views/components/Editor.vue b/src/views/components/Editor.vue index b602d70..13a3481 100644 --- a/src/views/components/Editor.vue +++ b/src/views/components/Editor.vue @@ -41,7 +41,7 @@ export default { const _this = this var editor = new E(this.$refs.editor) // 自定义菜单配置 - editor.customConfig.zIndex = 10 + editor.customConfig.zIndex = 5 // 文件上传 editor.customConfig.customUploadImg = function(files, insert) { // files 是 input 中选中的文件列表 diff --git a/src/views/components/MarkDown.vue b/src/views/components/MarkDown.vue index 4eff05c..bb5a10e 100644 --- a/src/views/components/MarkDown.vue +++ b/src/views/components/MarkDown.vue @@ -43,4 +43,7 @@ export default {