Bladeren bron

优化代码

RuoYi 1 jaar geleden
bovenliggende
commit
3dcee7057d
21 gewijzigde bestanden met toevoegingen van 79 en 123 verwijderingen
  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
      * 转换为boolean<br>
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
      * @param value 被转换的值
546
      * @param value 被转换的值
547
      * @param defaultValue 转换错误时的默认值
547
      * @param defaultValue 转换错误时的默认值
548
      * @return 结果
548
      * @return 结果
@@ -569,10 +569,12 @@ public class Convert
569
             case "yes":
569
             case "yes":
570
             case "ok":
570
             case "ok":
571
             case "1":
571
             case "1":
572
+            case "是":
572
                 return true;
573
                 return true;
573
             case "false":
574
             case "false":
574
             case "no":
575
             case "no":
575
             case "0":
576
             case "0":
577
+            case "否":
576
                 return false;
578
                 return false;
577
             default:
579
             default:
578
                 return defaultValue;
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
      * @param list 列表数据
37
      * @param list 列表数据
38
      * @param total 总记录数
38
      * @param total 总记录数
39
      */
39
      */
40
-    public TableDataInfo(List<?> list, int total)
40
+    public TableDataInfo(List<?> list, long total)
41
     {
41
     {
42
         this.rows = list;
42
         this.rows = list;
43
         this.total = total;
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
     protected static final long MILLIS_MINUTE = 60 * MILLIS_SECOND;
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
     private final static String ACCESS_TOKEN = CacheConstants.LOGIN_TOKEN_KEY;
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
         Map<String, Object> rspMap = new HashMap<String, Object>();
66
         Map<String, Object> rspMap = new HashMap<String, Object>();
67
         rspMap.put("access_token", JwtUtils.createToken(claimsMap));
67
         rspMap.put("access_token", JwtUtils.createToken(claimsMap));
68
-        rspMap.put("expires_in", expireTime);
68
+        rspMap.put("expires_in", TOKEN_EXPIRE_TIME);
69
         return rspMap;
69
         return rspMap;
70
     }
70
     }
71
 
71
 
@@ -147,7 +147,7 @@ public class TokenService
147
     {
147
     {
148
         long expireTime = loginUser.getExpireTime();
148
         long expireTime = loginUser.getExpireTime();
149
         long currentTime = System.currentTimeMillis();
149
         long currentTime = System.currentTimeMillis();
150
-        if (expireTime - currentTime <= MILLIS_MINUTE_TEN)
150
+        if (expireTime - currentTime <= TOKEN_REFRESH_THRESHOLD_MINUTES)
151
         {
151
         {
152
             refreshToken(loginUser);
152
             refreshToken(loginUser);
153
         }
153
         }
@@ -161,10 +161,10 @@ public class TokenService
161
     public void refreshToken(LoginUser loginUser)
161
     public void refreshToken(LoginUser loginUser)
162
     {
162
     {
163
         loginUser.setLoginTime(System.currentTimeMillis());
163
         loginUser.setLoginTime(System.currentTimeMillis());
164
-        loginUser.setExpireTime(loginUser.getLoginTime() + expireTime * MILLIS_MINUTE);
164
+        loginUser.setExpireTime(loginUser.getLoginTime() + TOKEN_EXPIRE_TIME * MILLIS_MINUTE);
165
         // 根据uuid将loginUser缓存
165
         // 根据uuid将loginUser缓存
166
         String userKey = getTokenKey(loginUser.getToken());
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
     private String getTokenKey(String token)
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
         int row = genTableMapper.updateGenTable(genTable);
129
         int row = genTableMapper.updateGenTable(genTable);
130
         if (row > 0)
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
                 throw new ServiceException("树名称字段不能为空");
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
         return $column.javaField;
72
         return $column.javaField;
73
     }
73
     }
74
+
74
 #end
75
 #end
75
 #end
76
 #end
76
-
77
 #if($table.sub)
77
 #if($table.sub)
78
     public List<${subClassName}> get${subClassName}List()
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
           icon="el-icon-plus"
75
           icon="el-icon-plus"
76
           size="mini"
76
           size="mini"
77
           @click="handleAdd"
77
           @click="handleAdd"
78
-          v-hasPermi="['${moduleName}:${businessName}:add']"
78
+          v-hasPermi="['${permissionPrefix}:add']"
79
         >新增</el-button>
79
         >新增</el-button>
80
       </el-col>
80
       </el-col>
81
       <el-col :span="1.5">
81
       <el-col :span="1.5">
@@ -144,21 +144,21 @@
144
             type="text"
144
             type="text"
145
             icon="el-icon-edit"
145
             icon="el-icon-edit"
146
             @click="handleUpdate(scope.row)"
146
             @click="handleUpdate(scope.row)"
147
-            v-hasPermi="['${moduleName}:${businessName}:edit']"
147
+            v-hasPermi="['${permissionPrefix}:edit']"
148
           >修改</el-button>
148
           >修改</el-button>
149
           <el-button
149
           <el-button
150
             size="mini"
150
             size="mini"
151
             type="text"
151
             type="text"
152
             icon="el-icon-plus"
152
             icon="el-icon-plus"
153
             @click="handleAdd(scope.row)"
153
             @click="handleAdd(scope.row)"
154
-            v-hasPermi="['${moduleName}:${businessName}:add']"
154
+            v-hasPermi="['${permissionPrefix}:add']"
155
           >新增</el-button>
155
           >新增</el-button>
156
           <el-button
156
           <el-button
157
             size="mini"
157
             size="mini"
158
             type="text"
158
             type="text"
159
             icon="el-icon-delete"
159
             icon="el-icon-delete"
160
             @click="handleDelete(scope.row)"
160
             @click="handleDelete(scope.row)"
161
-            v-hasPermi="['${moduleName}:${businessName}:remove']"
161
+            v-hasPermi="['${permissionPrefix}:remove']"
162
           >删除</el-button>
162
           >删除</el-button>
163
         </template>
163
         </template>
164
       </el-table-column>
164
       </el-table-column>
@@ -453,7 +453,7 @@ export default {
453
       this.reset();
453
       this.reset();
454
       this.getTreeselect();
454
       this.getTreeselect();
455
       if (row != null) {
455
       if (row != null) {
456
-        this.form.${treeParentCode} = row.${treeCode};
456
+        this.form.${treeParentCode} = row.${treeParentCode};
457
       }
457
       }
458
       get${BusinessName}(row.${pkColumn.javaField}).then(response => {
458
       get${BusinessName}(row.${pkColumn.javaField}).then(response => {
459
         this.form = response.data;
459
         this.form = response.data;

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

@@ -75,7 +75,7 @@
75
           icon="el-icon-plus"
75
           icon="el-icon-plus"
76
           size="mini"
76
           size="mini"
77
           @click="handleAdd"
77
           @click="handleAdd"
78
-          v-hasPermi="['${moduleName}:${businessName}:add']"
78
+          v-hasPermi="['${permissionPrefix}:add']"
79
         >新增</el-button>
79
         >新增</el-button>
80
       </el-col>
80
       </el-col>
81
       <el-col :span="1.5">
81
       <el-col :span="1.5">
@@ -86,7 +86,7 @@
86
           size="mini"
86
           size="mini"
87
           :disabled="single"
87
           :disabled="single"
88
           @click="handleUpdate"
88
           @click="handleUpdate"
89
-          v-hasPermi="['${moduleName}:${businessName}:edit']"
89
+          v-hasPermi="['${permissionPrefix}:edit']"
90
         >修改</el-button>
90
         >修改</el-button>
91
       </el-col>
91
       </el-col>
92
       <el-col :span="1.5">
92
       <el-col :span="1.5">
@@ -97,7 +97,7 @@
97
           size="mini"
97
           size="mini"
98
           :disabled="multiple"
98
           :disabled="multiple"
99
           @click="handleDelete"
99
           @click="handleDelete"
100
-          v-hasPermi="['${moduleName}:${businessName}:remove']"
100
+          v-hasPermi="['${permissionPrefix}:remove']"
101
         >删除</el-button>
101
         >删除</el-button>
102
       </el-col>
102
       </el-col>
103
       <el-col :span="1.5">
103
       <el-col :span="1.5">
@@ -107,7 +107,7 @@
107
           icon="el-icon-download"
107
           icon="el-icon-download"
108
           size="mini"
108
           size="mini"
109
           @click="handleExport"
109
           @click="handleExport"
110
-          v-hasPermi="['${moduleName}:${businessName}:export']"
110
+          v-hasPermi="['${permissionPrefix}:export']"
111
         >导出</el-button>
111
         >导出</el-button>
112
       </el-col>
112
       </el-col>
113
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
113
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -158,14 +158,14 @@
158
             type="text"
158
             type="text"
159
             icon="el-icon-edit"
159
             icon="el-icon-edit"
160
             @click="handleUpdate(scope.row)"
160
             @click="handleUpdate(scope.row)"
161
-            v-hasPermi="['${moduleName}:${businessName}:edit']"
161
+            v-hasPermi="['${permissionPrefix}:edit']"
162
           >修改</el-button>
162
           >修改</el-button>
163
           <el-button
163
           <el-button
164
             size="mini"
164
             size="mini"
165
             type="text"
165
             type="text"
166
             icon="el-icon-delete"
166
             icon="el-icon-delete"
167
             @click="handleDelete(scope.row)"
167
             @click="handleDelete(scope.row)"
168
-            v-hasPermi="['${moduleName}:${businessName}:remove']"
168
+            v-hasPermi="['${permissionPrefix}:remove']"
169
           >删除</el-button>
169
           >删除</el-button>
170
         </template>
170
         </template>
171
       </el-table-column>
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
           plain
73
           plain
74
           icon="Plus"
74
           icon="Plus"
75
           @click="handleAdd"
75
           @click="handleAdd"
76
-          v-hasPermi="['${moduleName}:${businessName}:add']"
76
+          v-hasPermi="['${permissionPrefix}:add']"
77
         >新增</el-button>
77
         >新增</el-button>
78
       </el-col>
78
       </el-col>
79
       <el-col :span="1.5">
79
       <el-col :span="1.5">
@@ -136,9 +136,9 @@
136
 #end
136
 #end
137
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
137
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
138
         <template #default="scope">
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
         </template>
142
         </template>
143
       </el-table-column>
143
       </el-table-column>
144
     </el-table>
144
     </el-table>
@@ -420,7 +420,7 @@ async function handleUpdate(row) {
420
   reset();
420
   reset();
421
   await getTreeselect();
421
   await getTreeselect();
422
   if (row != null) {
422
   if (row != null) {
423
-    form.value.${treeParentCode} = row.${treeCode};
423
+    form.value.${treeParentCode} = row.${treeParentCode};
424
   }
424
   }
425
   get${BusinessName}(row.${pkColumn.javaField}).then(response => {
425
   get${BusinessName}(row.${pkColumn.javaField}).then(response => {
426
     form.value = response.data;
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
           plain
73
           plain
74
           icon="Plus"
74
           icon="Plus"
75
           @click="handleAdd"
75
           @click="handleAdd"
76
-          v-hasPermi="['${moduleName}:${businessName}:add']"
76
+          v-hasPermi="['${permissionPrefix}:add']"
77
         >新增</el-button>
77
         >新增</el-button>
78
       </el-col>
78
       </el-col>
79
       <el-col :span="1.5">
79
       <el-col :span="1.5">
@@ -83,7 +83,7 @@
83
           icon="Edit"
83
           icon="Edit"
84
           :disabled="single"
84
           :disabled="single"
85
           @click="handleUpdate"
85
           @click="handleUpdate"
86
-          v-hasPermi="['${moduleName}:${businessName}:edit']"
86
+          v-hasPermi="['${permissionPrefix}:edit']"
87
         >修改</el-button>
87
         >修改</el-button>
88
       </el-col>
88
       </el-col>
89
       <el-col :span="1.5">
89
       <el-col :span="1.5">
@@ -93,7 +93,7 @@
93
           icon="Delete"
93
           icon="Delete"
94
           :disabled="multiple"
94
           :disabled="multiple"
95
           @click="handleDelete"
95
           @click="handleDelete"
96
-          v-hasPermi="['${moduleName}:${businessName}:remove']"
96
+          v-hasPermi="['${permissionPrefix}:remove']"
97
         >删除</el-button>
97
         >删除</el-button>
98
       </el-col>
98
       </el-col>
99
       <el-col :span="1.5">
99
       <el-col :span="1.5">
@@ -102,7 +102,7 @@
102
           plain
102
           plain
103
           icon="Download"
103
           icon="Download"
104
           @click="handleExport"
104
           @click="handleExport"
105
-          v-hasPermi="['${moduleName}:${businessName}:export']"
105
+          v-hasPermi="['${permissionPrefix}:export']"
106
         >导出</el-button>
106
         >导出</el-button>
107
       </el-col>
107
       </el-col>
108
       <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
108
       <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
@@ -148,8 +148,8 @@
148
 #end
148
 #end
149
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
149
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
150
         <template #default="scope">
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
         </template>
153
         </template>
154
       </el-table-column>
154
       </el-table-column>
155
     </el-table>
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
      * @param path 路由地址
369
      * @param path 路由地址
370
      * @return 路由名称(驼峰格式)
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
                 // 多角色设置permissions属性,以便数据权限匹配权限
73
                 // 多角色设置permissions属性,以便数据权限匹配权限
74
                 for (SysRole role : roles)
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
                         Set<String> rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId());
78
                         Set<String> rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId());
79
                         role.setPermissions(rolePerms);
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
  		insert into sys_user(
146
  		insert into sys_user(
147
  			<if test="userId != null and userId != 0">user_id,</if>
147
  			<if test="userId != null and userId != 0">user_id,</if>
148
  			<if test="deptId != null and deptId != 0">dept_id,</if>
148
  			<if test="deptId != null and deptId != 0">dept_id,</if>
149
- 			<if test="userName != null and userName != ''">user_name,</if>
150
  			<if test="nickName != null and nickName != ''">nick_name,</if>
149
  			<if test="nickName != null and nickName != ''">nick_name,</if>
151
  			<if test="email != null and email != ''">email,</if>
150
  			<if test="email != null and email != ''">email,</if>
152
  			<if test="avatar != null and avatar != ''">avatar,</if>
151
  			<if test="avatar != null and avatar != ''">avatar,</if>

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

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

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

@@ -117,11 +117,9 @@
117
 
117
 
118
 /** 表格布局 **/
118
 /** 表格布局 **/
119
 .pagination-container {
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
 /* tree border */
125
 /* tree border */
@@ -132,11 +130,6 @@
132
   border-radius: 4px;
130
   border-radius: 4px;
133
 }
131
 }
134
 
132
 
135
-.pagination-container .el-pagination {
136
-  right: 0;
137
-  position: absolute;
138
-}
139
-
140
 @media (max-width: 768px) {
133
 @media (max-width: 768px) {
141
   .pagination-container .el-pagination > .el-pagination__jump {
134
   .pagination-container .el-pagination > .el-pagination__jump {
142
     display: none !important;
135
     display: none !important;
@@ -201,8 +194,6 @@
201
 }
194
 }
202
 
195
 
203
 .card-box {
196
 .card-box {
204
-  padding-right: 15px;
205
-  padding-left: 15px;
206
   margin-bottom: 10px;
197
   margin-bottom: 10px;
207
 }
198
 }
208
 
199
 

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

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

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

@@ -2,8 +2,8 @@
2
   <div class="navbar">
2
   <div class="navbar">
3
     <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
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
     <div class="right-menu">
8
     <div class="right-menu">
9
       <template v-if="device!=='mobile'">
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
 function filterChildren(childrenMap, lastRouter = false) {
83
 function filterChildren(childrenMap, lastRouter = false) {
84
   var children = []
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
   return children
93
   return children
109
 }
94
 }

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

@@ -1,5 +1,3 @@
1
-
2
-
3
 /**
1
 /**
4
  * 通用js方法封装处理
2
  * 通用js方法封装处理
5
  * Copyright (c) 2019 ruoyi
3
  * Copyright (c) 2019 ruoyi
@@ -165,37 +163,19 @@ export function handleTree(data, id, parentId, children) {
165
   };
163
   };
166
 
164
 
167
   var childrenListMap = {};
165
   var childrenListMap = {};
168
-  var nodeIds = {};
169
   var tree = [];
166
   var tree = [];
170
-
171
   for (let d of data) {
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
   for (let d of data) {
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
       tree.push(d);
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
   return tree;
181
   return tree;
@@ -227,6 +207,18 @@ export function tansParams(params) {
227
   return result
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
 // 验证是否为blob格式
222
 // 验证是否为blob格式
231
 export function blobValidate(data) {
223
 export function blobValidate(data) {
232
   return data.type !== 'application/json'
224
   return data.type !== 'application/json'

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

@@ -1,14 +1,6 @@
1
 <template>
1
 <template>
2
   <div class="app-container home">
2
   <div class="app-container home">
3
     <el-row :gutter="20">
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
       <el-col :sm="24" :lg="12" style="padding-left: 20px">
4
       <el-col :sm="24" :lg="12" style="padding-left: 20px">
13
         <h2>若依后台管理框架</h2>
5
         <h2>若依后台管理框架</h2>
14
         <p>
6
         <p>

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

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

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

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