From c24fc4282c81506812019c57e2008fe75b4b8f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=9A=E5=B1=BF?= <1491182878@qq.com> Date: Tue, 20 Jul 2021 00:54:50 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=90=8D=E5=8D=95=E8=AF=8D=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/framework/web/service/SysLoginService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java index d605303e..37c38866 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java @@ -62,7 +62,7 @@ public class SysLoginService // 验证码开关 if (captchaOnOff) { - validateCapcha(username, code, uuid); + validateCaptcha(username, code, uuid); } // 用户验证 Authentication authentication = null; @@ -100,7 +100,7 @@ public class SysLoginService * @param uuid 唯一标识 * @return 结果 */ - public void validateCapcha(String username, String code, String uuid) + public void validateCaptcha(String username, String code, String uuid) { String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid; String captcha = redisCache.getCacheObject(verifyKey); From cdace51197a7acf10033cc12f2dce3a7aad326e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E4=BF=8A=E4=B8=9C?= <1172482914@qq.com> Date: Tue, 20 Jul 2021 04:49:22 +0000 Subject: [PATCH 2/3] =?UTF-8?q?code=3D401=E6=97=B6request=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E6=B2=A1=E6=9C=89=E8=BF=94=E5=9B=9EPromise.reject=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/utils/request.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js index a510d2da..6a7cbfa3 100644 --- a/ruoyi-ui/src/utils/request.js +++ b/ruoyi-ui/src/utils/request.js @@ -64,6 +64,7 @@ service.interceptors.response.use(res => { location.href = '/index'; }) }).catch(() => {}); + return Promise.reject('error') } else if (code === 500) { Message({ message: msg, From c43f9bc3c2433982706d289833aa2d5cb856ea16 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 24 Jul 2021 18:20:55 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=A1=B6=E9=83=A8=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=8E=92=E9=99=A4=E9=9A=90=E8=97=8F=E7=9A=84=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/components/TopNav/index.vue | 15 +++++++++++++-- ruoyi-ui/src/router/index.js | 2 -- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ruoyi-ui/src/components/TopNav/index.vue b/ruoyi-ui/src/components/TopNav/index.vue index c8837f2a..edb9c532 100644 --- a/ruoyi-ui/src/components/TopNav/index.vue +++ b/ruoyi-ui/src/components/TopNav/index.vue @@ -87,7 +87,7 @@ export default { // 默认激活的菜单 activeMenu() { const path = this.$route.path; - let activePath = this.routers[0].path; + let activePath = this.defaultRouter(); if (path.lastIndexOf("/") > 0) { const tmpPath = path.substring(1, path.length); activePath = "/" + tmpPath.substring(0, tmpPath.indexOf("/")); @@ -100,7 +100,7 @@ export default { } var routes = this.activeRoutes(activePath); if (routes.length === 0) { - activePath = this.currentIndex || this.routers[0].path + activePath = this.currentIndex || this.defaultRouter() this.activeRoutes(activePath); } return activePath; @@ -121,6 +121,17 @@ export default { const width = document.body.getBoundingClientRect().width / 3; this.visibleNumber = parseInt(width / 85); }, + // 默认激活的路由 + defaultRouter() { + let router; + Object.keys(this.routers).some((key) => { + if (!this.routers[key].hidden) { + router = this.routers[key].path; + return true; + } + }); + return router; + }, // 菜单选择事件 handleSelect(key, keyPath) { this.currentIndex = key; diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 7f0b1059..d0c4b0b0 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -5,8 +5,6 @@ Vue.use(Router) /* Layout */ import Layout from '@/layout' -import ParentView from '@/components/ParentView'; -import InnerLink from '@/layout/components/InnerLink' /** * Note: 路由配置项