RuoYi 1 год назад
Родитель
Сommit
3dcee7057d
21 измененных файлов с 79 добавлено и 123 удалено
  1. 4 2
      ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/text/Convert.java
  2. 1 1
      ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/TableDataInfo.java
  3. 6 6
      ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/service/TokenService.java
  4. 11 11
      ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/service/GenTableServiceImpl.java
  5. 1 1
      ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/domain.java.vm
  6. 5 5
      ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm
  7. 6 6
      ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm
  8. 5 5
      ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index-tree.vue.vm
  9. 6 6
      ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index.vue.vm
  10. 1 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
  11. 1 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPermissionServiceImpl.java
  12. 0 1
      ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
  13. 0 4
      ruoyi-ui/src/assets/styles/index.scss
  14. 3 12
      ruoyi-ui/src/assets/styles/ruoyi.scss
  15. 0 1
      ruoyi-ui/src/components/Pagination/index.vue
  16. 2 2
      ruoyi-ui/src/layout/components/Navbar.vue
  17. 6 21
      ruoyi-ui/src/store/modules/permission.js
  18. 19 27
      ruoyi-ui/src/utils/ruoyi.js
  19. 0 8
      ruoyi-ui/src/views/index.vue
  20. 1 1
      ruoyi-ui/src/views/system/logininfor/index.vue
  21. 1 1
      ruoyi-ui/src/views/system/operlog/index.vue

+ 4 - 2
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/text/Convert.java

@@ -540,9 +540,9 @@ public class Convert
540 540
 
541 541
     /**
542 542
      * 转换为boolean<br>
543
-     * String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值<br>
543
+     * String支持的值为:true、false、yes、ok、no、1、0、是、否, 如果给定的值为空,或者转换失败,返回默认值<br>
544 544
      * 转换失败不会报错
545
-     * 
545
+     *
546 546
      * @param value 被转换的值
547 547
      * @param defaultValue 转换错误时的默认值
548 548
      * @return 结果
@@ -569,10 +569,12 @@ public class Convert
569 569
             case "yes":
570 570
             case "ok":
571 571
             case "1":
572
+            case "是":
572 573
                 return true;
573 574
             case "false":
574 575
             case "no":
575 576
             case "0":
577
+            case "否":
576 578
                 return false;
577 579
             default:
578 580
                 return defaultValue;

+ 1 - 1
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/TableDataInfo.java

@@ -37,7 +37,7 @@ public class TableDataInfo implements Serializable
37 37
      * @param list 列表数据
38 38
      * @param total 总记录数
39 39
      */
40
-    public TableDataInfo(List<?> list, int total)
40
+    public TableDataInfo(List<?> list, long total)
41 41
     {
42 42
         this.rows = list;
43 43
         this.total = total;

+ 6 - 6
ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/service/TokenService.java

@@ -36,11 +36,11 @@ public class TokenService
36 36
 
37 37
     protected static final long MILLIS_MINUTE = 60 * MILLIS_SECOND;
38 38
 
39
-    private final static long expireTime = CacheConstants.EXPIRATION;
39
+    private final static long TOKEN_EXPIRE_TIME = CacheConstants.EXPIRATION;
40 40
 
41 41
     private final static String ACCESS_TOKEN = CacheConstants.LOGIN_TOKEN_KEY;
42 42
 
43
-    private final static Long MILLIS_MINUTE_TEN = CacheConstants.REFRESH_TIME * MILLIS_MINUTE;
43
+    private final static Long TOKEN_REFRESH_THRESHOLD_MINUTES = CacheConstants.REFRESH_TIME * MILLIS_MINUTE;
44 44
 
45 45
     /**
46 46
      * 创建令牌
@@ -65,7 +65,7 @@ public class TokenService
65 65
         // 接口返回信息
66 66
         Map<String, Object> rspMap = new HashMap<String, Object>();
67 67
         rspMap.put("access_token", JwtUtils.createToken(claimsMap));
68
-        rspMap.put("expires_in", expireTime);
68
+        rspMap.put("expires_in", TOKEN_EXPIRE_TIME);
69 69
         return rspMap;
70 70
     }
71 71
 
@@ -147,7 +147,7 @@ public class TokenService
147 147
     {
148 148
         long expireTime = loginUser.getExpireTime();
149 149
         long currentTime = System.currentTimeMillis();
150
-        if (expireTime - currentTime <= MILLIS_MINUTE_TEN)
150
+        if (expireTime - currentTime <= TOKEN_REFRESH_THRESHOLD_MINUTES)
151 151
         {
152 152
             refreshToken(loginUser);
153 153
         }
@@ -161,10 +161,10 @@ public class TokenService
161 161
     public void refreshToken(LoginUser loginUser)
162 162
     {
163 163
         loginUser.setLoginTime(System.currentTimeMillis());
164
-        loginUser.setExpireTime(loginUser.getLoginTime() + expireTime * MILLIS_MINUTE);
164
+        loginUser.setExpireTime(loginUser.getLoginTime() + TOKEN_EXPIRE_TIME * MILLIS_MINUTE);
165 165
         // 根据uuid将loginUser缓存
166 166
         String userKey = getTokenKey(loginUser.getToken());
167
-        redisService.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES);
167
+        redisService.setCacheObject(userKey, loginUser, TOKEN_EXPIRE_TIME, TimeUnit.MINUTES);
168 168
     }
169 169
 
170 170
     private String getTokenKey(String token)

+ 11 - 11
ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/service/GenTableServiceImpl.java

@@ -129,9 +129,9 @@ public class GenTableServiceImpl implements IGenTableService
129 129
         int row = genTableMapper.updateGenTable(genTable);
130 130
         if (row > 0)
131 131
         {
132
-            for (GenTableColumn cenTableColumn : genTable.getColumns())
132
+            for (GenTableColumn genTableColumn : genTable.getColumns())
133 133
             {
134
-                genTableColumnMapper.updateGenTableColumn(cenTableColumn);
134
+                genTableColumnMapper.updateGenTableColumn(genTableColumn);
135 135
             }
136 136
         }
137 137
     }
@@ -414,16 +414,16 @@ public class GenTableServiceImpl implements IGenTableService
414 414
             {
415 415
                 throw new ServiceException("树名称字段不能为空");
416 416
             }
417
-            else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory()))
417
+        }
418
+        else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory()))
419
+        {
420
+            if (StringUtils.isEmpty(genTable.getSubTableName()))
418 421
             {
419
-                if (StringUtils.isEmpty(genTable.getSubTableName()))
420
-                {
421
-                    throw new ServiceException("关联子表的表名不能为空");
422
-                }
423
-                else if (StringUtils.isEmpty(genTable.getSubTableFkName()))
424
-                {
425
-                    throw new ServiceException("子表关联的外键名不能为空");
426
-                }
422
+                throw new ServiceException("关联子表的表名不能为空");
423
+            }
424
+            else if (StringUtils.isEmpty(genTable.getSubTableFkName()))
425
+            {
426
+                throw new ServiceException("子表关联的外键名不能为空");
427 427
             }
428 428
         }
429 429
     }

+ 1 - 1
ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/domain.java.vm

@@ -71,9 +71,9 @@ public class ${ClassName} extends ${Entity}
71 71
     {
72 72
         return $column.javaField;
73 73
     }
74
+
74 75
 #end
75 76
 #end
76
-
77 77
 #if($table.sub)
78 78
     public List<${subClassName}> get${subClassName}List()
79 79
     {

+ 5 - 5
ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm

@@ -75,7 +75,7 @@
75 75
           icon="el-icon-plus"
76 76
           size="mini"
77 77
           @click="handleAdd"
78
-          v-hasPermi="['${moduleName}:${businessName}:add']"
78
+          v-hasPermi="['${permissionPrefix}:add']"
79 79
         >新增</el-button>
80 80
       </el-col>
81 81
       <el-col :span="1.5">
@@ -144,21 +144,21 @@
144 144
             type="text"
145 145
             icon="el-icon-edit"
146 146
             @click="handleUpdate(scope.row)"
147
-            v-hasPermi="['${moduleName}:${businessName}:edit']"
147
+            v-hasPermi="['${permissionPrefix}:edit']"
148 148
           >修改</el-button>
149 149
           <el-button
150 150
             size="mini"
151 151
             type="text"
152 152
             icon="el-icon-plus"
153 153
             @click="handleAdd(scope.row)"
154
-            v-hasPermi="['${moduleName}:${businessName}:add']"
154
+            v-hasPermi="['${permissionPrefix}:add']"
155 155
           >新增</el-button>
156 156
           <el-button
157 157
             size="mini"
158 158
             type="text"
159 159
             icon="el-icon-delete"
160 160
             @click="handleDelete(scope.row)"
161
-            v-hasPermi="['${moduleName}:${businessName}:remove']"
161
+            v-hasPermi="['${permissionPrefix}:remove']"
162 162
           >删除</el-button>
163 163
         </template>
164 164
       </el-table-column>
@@ -453,7 +453,7 @@ export default {
453 453
       this.reset();
454 454
       this.getTreeselect();
455 455
       if (row != null) {
456
-        this.form.${treeParentCode} = row.${treeCode};
456
+        this.form.${treeParentCode} = row.${treeParentCode};
457 457
       }
458 458
       get${BusinessName}(row.${pkColumn.javaField}).then(response => {
459 459
         this.form = response.data;

+ 6 - 6
ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm

@@ -75,7 +75,7 @@
75 75
           icon="el-icon-plus"
76 76
           size="mini"
77 77
           @click="handleAdd"
78
-          v-hasPermi="['${moduleName}:${businessName}:add']"
78
+          v-hasPermi="['${permissionPrefix}:add']"
79 79
         >新增</el-button>
80 80
       </el-col>
81 81
       <el-col :span="1.5">
@@ -86,7 +86,7 @@
86 86
           size="mini"
87 87
           :disabled="single"
88 88
           @click="handleUpdate"
89
-          v-hasPermi="['${moduleName}:${businessName}:edit']"
89
+          v-hasPermi="['${permissionPrefix}:edit']"
90 90
         >修改</el-button>
91 91
       </el-col>
92 92
       <el-col :span="1.5">
@@ -97,7 +97,7 @@
97 97
           size="mini"
98 98
           :disabled="multiple"
99 99
           @click="handleDelete"
100
-          v-hasPermi="['${moduleName}:${businessName}:remove']"
100
+          v-hasPermi="['${permissionPrefix}:remove']"
101 101
         >删除</el-button>
102 102
       </el-col>
103 103
       <el-col :span="1.5">
@@ -107,7 +107,7 @@
107 107
           icon="el-icon-download"
108 108
           size="mini"
109 109
           @click="handleExport"
110
-          v-hasPermi="['${moduleName}:${businessName}:export']"
110
+          v-hasPermi="['${permissionPrefix}:export']"
111 111
         >导出</el-button>
112 112
       </el-col>
113 113
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -158,14 +158,14 @@
158 158
             type="text"
159 159
             icon="el-icon-edit"
160 160
             @click="handleUpdate(scope.row)"
161
-            v-hasPermi="['${moduleName}:${businessName}:edit']"
161
+            v-hasPermi="['${permissionPrefix}:edit']"
162 162
           >修改</el-button>
163 163
           <el-button
164 164
             size="mini"
165 165
             type="text"
166 166
             icon="el-icon-delete"
167 167
             @click="handleDelete(scope.row)"
168
-            v-hasPermi="['${moduleName}:${businessName}:remove']"
168
+            v-hasPermi="['${permissionPrefix}:remove']"
169 169
           >删除</el-button>
170 170
         </template>
171 171
       </el-table-column>

+ 5 - 5
ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index-tree.vue.vm

@@ -73,7 +73,7 @@
73 73
           plain
74 74
           icon="Plus"
75 75
           @click="handleAdd"
76
-          v-hasPermi="['${moduleName}:${businessName}:add']"
76
+          v-hasPermi="['${permissionPrefix}:add']"
77 77
         >新增</el-button>
78 78
       </el-col>
79 79
       <el-col :span="1.5">
@@ -136,9 +136,9 @@
136 136
 #end
137 137
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
138 138
         <template #default="scope">
139
-          <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button>
140
-          <el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${moduleName}:${businessName}:add']">新增</el-button>
141
-          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button>
139
+          <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
140
+          <el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${permissionPrefix}:add']">新增</el-button>
141
+          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
142 142
         </template>
143 143
       </el-table-column>
144 144
     </el-table>
@@ -420,7 +420,7 @@ async function handleUpdate(row) {
420 420
   reset();
421 421
   await getTreeselect();
422 422
   if (row != null) {
423
-    form.value.${treeParentCode} = row.${treeCode};
423
+    form.value.${treeParentCode} = row.${treeParentCode};
424 424
   }
425 425
   get${BusinessName}(row.${pkColumn.javaField}).then(response => {
426 426
     form.value = response.data;

+ 6 - 6
ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index.vue.vm

@@ -73,7 +73,7 @@
73 73
           plain
74 74
           icon="Plus"
75 75
           @click="handleAdd"
76
-          v-hasPermi="['${moduleName}:${businessName}:add']"
76
+          v-hasPermi="['${permissionPrefix}:add']"
77 77
         >新增</el-button>
78 78
       </el-col>
79 79
       <el-col :span="1.5">
@@ -83,7 +83,7 @@
83 83
           icon="Edit"
84 84
           :disabled="single"
85 85
           @click="handleUpdate"
86
-          v-hasPermi="['${moduleName}:${businessName}:edit']"
86
+          v-hasPermi="['${permissionPrefix}:edit']"
87 87
         >修改</el-button>
88 88
       </el-col>
89 89
       <el-col :span="1.5">
@@ -93,7 +93,7 @@
93 93
           icon="Delete"
94 94
           :disabled="multiple"
95 95
           @click="handleDelete"
96
-          v-hasPermi="['${moduleName}:${businessName}:remove']"
96
+          v-hasPermi="['${permissionPrefix}:remove']"
97 97
         >删除</el-button>
98 98
       </el-col>
99 99
       <el-col :span="1.5">
@@ -102,7 +102,7 @@
102 102
           plain
103 103
           icon="Download"
104 104
           @click="handleExport"
105
-          v-hasPermi="['${moduleName}:${businessName}:export']"
105
+          v-hasPermi="['${permissionPrefix}:export']"
106 106
         >导出</el-button>
107 107
       </el-col>
108 108
       <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
@@ -148,8 +148,8 @@
148 148
 #end
149 149
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
150 150
         <template #default="scope">
151
-          <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button>
152
-          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button>
151
+          <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
152
+          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
153 153
         </template>
154 154
       </el-table-column>
155 155
     </el-table>

+ 1 - 1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java

@@ -365,7 +365,7 @@ public class SysMenuServiceImpl implements ISysMenuService
365 365
     /**
366 366
      * 获取路由名称,如没有配置路由名称则取路由地址
367 367
      * 
368
-     * @param routerName 路由名称
368
+     * @param name 路由名称
369 369
      * @param path 路由地址
370 370
      * @return 路由名称(驼峰格式)
371 371
      */

+ 1 - 1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPermissionServiceImpl.java

@@ -73,7 +73,7 @@ public class SysPermissionServiceImpl implements ISysPermissionService
73 73
                 // 多角色设置permissions属性,以便数据权限匹配权限
74 74
                 for (SysRole role : roles)
75 75
                 {
76
-                    if (StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL))
76
+                    if (StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL) && !role.isAdmin())
77 77
                     {
78 78
                         Set<String> rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId());
79 79
                         role.setPermissions(rolePerms);

+ 0 - 1
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -146,7 +146,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
146 146
  		insert into sys_user(
147 147
  			<if test="userId != null and userId != 0">user_id,</if>
148 148
  			<if test="deptId != null and deptId != 0">dept_id,</if>
149
- 			<if test="userName != null and userName != ''">user_name,</if>
150 149
  			<if test="nickName != null and nickName != ''">nick_name,</if>
151 150
  			<if test="email != null and email != ''">email,</if>
152 151
  			<if test="avatar != null and avatar != ''">avatar,</if>

+ 0 - 4
ruoyi-ui/src/assets/styles/index.scss

@@ -129,10 +129,6 @@ aside {
129 129
   position: relative;
130 130
 }
131 131
 
132
-.pagination-container {
133
-  margin-top: 30px;
134
-}
135
-
136 132
 .text-center {
137 133
   text-align: center
138 134
 }

+ 3 - 12
ruoyi-ui/src/assets/styles/ruoyi.scss

@@ -117,11 +117,9 @@
117 117
 
118 118
 /** 表格布局 **/
119 119
 .pagination-container {
120
-  position: relative;
121
-  height: 32px;
122
-  margin-bottom: 10px;
123
-  margin-top: 15px;
124
-  padding: 10px 20px !important;
120
+  display: flex;
121
+  justify-content: flex-end;
122
+  margin-top: 20px;
125 123
 }
126 124
 
127 125
 /* tree border */
@@ -132,11 +130,6 @@
132 130
   border-radius: 4px;
133 131
 }
134 132
 
135
-.pagination-container .el-pagination {
136
-  right: 0;
137
-  position: absolute;
138
-}
139
-
140 133
 @media (max-width: 768px) {
141 134
   .pagination-container .el-pagination > .el-pagination__jump {
142 135
     display: none !important;
@@ -201,8 +194,6 @@
201 194
 }
202 195
 
203 196
 .card-box {
204
-  padding-right: 15px;
205
-  padding-left: 15px;
206 197
   margin-bottom: 10px;
207 198
 }
208 199
 

+ 0 - 1
ruoyi-ui/src/components/Pagination/index.vue

@@ -106,7 +106,6 @@ export default {
106 106
 <style scoped>
107 107
 .pagination-container {
108 108
   background: #fff;
109
-  padding: 32px 16px;
110 109
 }
111 110
 .pagination-container.hidden {
112 111
   display: none;

+ 2 - 2
ruoyi-ui/src/layout/components/Navbar.vue

@@ -2,8 +2,8 @@
2 2
   <div class="navbar">
3 3
     <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
4 4
 
5
-    <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
6
-    <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
5
+    <breadcrumb v-if="!topNav" id="breadcrumb-container" class="breadcrumb-container" />
6
+    <top-nav v-if="topNav" id="topmenu-container" class="topmenu-container" />
7 7
 
8 8
     <div class="right-menu">
9 9
       <template v-if="device!=='mobile'">

+ 6 - 21
ruoyi-ui/src/store/modules/permission.js

@@ -82,28 +82,13 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
82 82
 
83 83
 function filterChildren(childrenMap, lastRouter = false) {
84 84
   var children = []
85
-  childrenMap.forEach((el, index) => {
86
-    if (el.children && el.children.length) {
87
-      if (el.component === 'ParentView' && !lastRouter) {
88
-        el.children.forEach(c => {
89
-          c.path = el.path + '/' + c.path
90
-          if (c.children && c.children.length) {
91
-            children = children.concat(filterChildren(c.children, c))
92
-            return
93
-          }
94
-          children.push(c)
95
-        })
96
-        return
97
-      }
98
-    }
99
-    if (lastRouter) {
100
-      el.path = lastRouter.path + '/' + el.path
101
-      if (el.children && el.children.length) {
102
-        children = children.concat(filterChildren(el.children, el))
103
-        return
104
-      }
85
+  childrenMap.forEach(el => {
86
+    el.path = lastRouter ? lastRouter.path + '/' + el.path : el.path
87
+    if (el.children && el.children.length && el.component === 'ParentView') {
88
+      children = children.concat(filterChildren(el.children, el))
89
+    } else {
90
+      children.push(el)
105 91
     }
106
-    children = children.concat(el)
107 92
   })
108 93
   return children
109 94
 }

+ 19 - 27
ruoyi-ui/src/utils/ruoyi.js

@@ -1,5 +1,3 @@
1
-
2
-
3 1
 /**
4 2
  * 通用js方法封装处理
5 3
  * Copyright (c) 2019 ruoyi
@@ -165,37 +163,19 @@ export function handleTree(data, id, parentId, children) {
165 163
   };
166 164
 
167 165
   var childrenListMap = {};
168
-  var nodeIds = {};
169 166
   var tree = [];
170
-
171 167
   for (let d of data) {
172
-    let parentId = d[config.parentId];
173
-    if (childrenListMap[parentId] == null) {
174
-      childrenListMap[parentId] = [];
175
-    }
176
-    nodeIds[d[config.id]] = d;
177
-    childrenListMap[parentId].push(d);
168
+    let id = d[config.id];
169
+    childrenListMap[id] = d;
178 170
   }
179 171
 
180 172
   for (let d of data) {
181
-    let parentId = d[config.parentId];
182
-    if (nodeIds[parentId] == null) {
173
+    let parentId = d[config.parentId]
174
+    let parentObj = childrenListMap[parentId]
175
+    if (!parentObj) {
183 176
       tree.push(d);
184
-    }
185
-  }
186
-
187
-  for (let t of tree) {
188
-    adaptToChildrenList(t);
189
-  }
190
-
191
-  function adaptToChildrenList(o) {
192
-    if (childrenListMap[o[config.id]] !== null) {
193
-      o[config.childrenList] = childrenListMap[o[config.id]];
194
-    }
195
-    if (o[config.childrenList]) {
196
-      for (let c of o[config.childrenList]) {
197
-        adaptToChildrenList(c);
198
-      }
177
+    } else {
178
+      parentObj[config.childrenList].push(d)
199 179
     }
200 180
   }
201 181
   return tree;
@@ -227,6 +207,18 @@ export function tansParams(params) {
227 207
   return result
228 208
 }
229 209
 
210
+// 返回项目路径
211
+export function getNormalPath(p) {
212
+  if (p.length === 0 || !p || p == 'undefined') {
213
+    return p
214
+  };
215
+  let res = p.replace('//', '/')
216
+  if (res[res.length - 1] === '/') {
217
+    return res.slice(0, res.length - 1)
218
+  }
219
+  return res
220
+}
221
+
230 222
 // 验证是否为blob格式
231 223
 export function blobValidate(data) {
232 224
   return data.type !== 'application/json'

+ 0 - 8
ruoyi-ui/src/views/index.vue

@@ -1,14 +1,6 @@
1 1
 <template>
2 2
   <div class="app-container home">
3 3
     <el-row :gutter="20">
4
-      <el-col :sm="24" :lg="24">
5
-        <blockquote class="text-warning" style="font-size: 14px">
6
-          阿里云服务器折扣区<el-link href="http://aly.ruoyi.vip" type="primary" target="_blank">☛☛点我进入☚☚</el-link> &nbsp;&nbsp;&nbsp; 腾讯云服务器秒杀区<el-link href="http://txy.ruoyi.vip" type="primary" target="_blank">☛☛点我进入☚☚</el-link>
7
-        </blockquote>
8
-        <hr />
9
-      </el-col>
10
-    </el-row>
11
-    <el-row :gutter="20">
12 4
       <el-col :sm="24" :lg="12" style="padding-left: 20px">
13 5
         <h2>若依后台管理框架</h2>
14 6
         <p>

+ 1 - 1
ruoyi-ui/src/views/system/logininfor/index.vue

@@ -153,7 +153,7 @@ export default {
153 153
       // 日期范围
154 154
       dateRange: [],
155 155
       // 默认排序
156
-      defaultSort: {prop: 'accessTime', order: 'descending'},
156
+      defaultSort: { prop: "accessTime", order: "descending" },
157 157
       // 查询参数
158 158
       queryParams: {
159 159
         pageNum: 1,

+ 1 - 1
ruoyi-ui/src/views/system/operlog/index.vue

@@ -231,7 +231,7 @@ export default {
231 231
       // 日期范围
232 232
       dateRange: [],
233 233
       // 默认排序
234
-      defaultSort: {prop: 'operTime', order: 'descending'},
234
+      defaultSort: { prop: "operTime", order: "descending" },
235 235
       // 表单参数
236 236
       form: {},
237 237
       // 查询参数