Explorar o código

Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev

 Conflicts:
	ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java
	ruoyi-ui/src/router/index.js
疯狂的狮子li %!s(int64=3) %!d(string=hai) anos
pai
achega
fbe9ad2392

+ 2 - 2
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java

@@ -65,7 +65,7 @@ public class SysLoginService
         // 验证码开关
         if (captchaOnOff)
         {
-            validateCapcha(username, code, uuid, request);
+            validateCaptcha(username, code, uuid, request);
         }
         // 用户验证
         Authentication authentication = null;
@@ -103,7 +103,7 @@ public class SysLoginService
      * @param uuid 唯一标识
      * @return 结果
      */
-    public void validateCapcha(String username, String code, String uuid, HttpServletRequest request) {
+    public void validateCaptcha(String username, String code, String uuid, HttpServletRequest request) {
 		String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
 		String captcha = redisCache.getCacheObject(verifyKey);
 		redisCache.deleteObject(verifyKey);

+ 13 - 2
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;

+ 0 - 2
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: 路由配置项

+ 1 - 0
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,