Commit 22f403b3ec2adabe28deeead5c159ad1f9ae8d56
1 parent
17a399b5
暂时还原
Showing
1 changed file
with
12 additions
and
13 deletions
jeecg-boot/src/main/java/org/jeecg/modules/system/controller/SysPermissionController.java
@@ -78,7 +78,7 @@ public class SysPermissionController { | @@ -78,7 +78,7 @@ public class SysPermissionController { | ||
78 | 78 | ||
79 | 79 | ||
80 | /** | 80 | /** |
81 | - * 查询用户拥有的菜单权限和按钮权限(根据用户账号) | 81 | + * 查询用户的权限 |
82 | * @return | 82 | * @return |
83 | */ | 83 | */ |
84 | @RequestMapping(value = "/queryByUser", method = RequestMethod.GET) | 84 | @RequestMapping(value = "/queryByUser", method = RequestMethod.GET) |
@@ -118,7 +118,7 @@ public class SysPermissionController { | @@ -118,7 +118,7 @@ public class SysPermissionController { | ||
118 | 118 | ||
119 | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | 119 | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
120 | @RequiresRoles({"admin"}) | 120 | @RequiresRoles({"admin"}) |
121 | - public Result<SysPermission> edit(@RequestBody SysPermission permission) { | 121 | + public Result<SysPermission> eidt(@RequestBody SysPermission permission) { |
122 | Result<SysPermission> result = new Result<>(); | 122 | Result<SysPermission> result = new Result<>(); |
123 | try { | 123 | try { |
124 | sysPermissionService.editPermission(permission); | 124 | sysPermissionService.editPermission(permission); |
@@ -264,12 +264,12 @@ public class SysPermissionController { | @@ -264,12 +264,12 @@ public class SysPermissionController { | ||
264 | SysPermissionTree tree = new SysPermissionTree(permission); | 264 | SysPermissionTree tree = new SysPermissionTree(permission); |
265 | if(temp==null && oConvertUtils.isEmpty(tempPid)) { | 265 | if(temp==null && oConvertUtils.isEmpty(tempPid)) { |
266 | treeList.add(tree); | 266 | treeList.add(tree); |
267 | - if(!tree.getIsLeaf()) { | 267 | + if(tree.getIsLeaf()==0) { |
268 | getTreeList(treeList, metaList, tree); | 268 | getTreeList(treeList, metaList, tree); |
269 | } | 269 | } |
270 | }else if(temp!=null && tempPid!=null && tempPid.equals(temp.getId())){ | 270 | }else if(temp!=null && tempPid!=null && tempPid.equals(temp.getId())){ |
271 | temp.getChildren().add(tree); | 271 | temp.getChildren().add(tree); |
272 | - if(!tree.getIsLeaf()) { | 272 | + if(tree.getIsLeaf()==0) { |
273 | getTreeList(treeList, metaList, tree); | 273 | getTreeList(treeList, metaList, tree); |
274 | } | 274 | } |
275 | } | 275 | } |
@@ -283,12 +283,12 @@ public class SysPermissionController { | @@ -283,12 +283,12 @@ public class SysPermissionController { | ||
283 | TreeModel tree = new TreeModel(permission); | 283 | TreeModel tree = new TreeModel(permission); |
284 | if(temp==null && oConvertUtils.isEmpty(tempPid)) { | 284 | if(temp==null && oConvertUtils.isEmpty(tempPid)) { |
285 | treeList.add(tree); | 285 | treeList.add(tree); |
286 | - if(!tree.getIsLeaf()) { | 286 | + if(permission.getIsLeaf()==0) { |
287 | getTreeModelList(treeList, metaList, tree); | 287 | getTreeModelList(treeList, metaList, tree); |
288 | } | 288 | } |
289 | }else if(temp!=null && tempPid!=null && tempPid.equals(temp.getKey())){ | 289 | }else if(temp!=null && tempPid!=null && tempPid.equals(temp.getKey())){ |
290 | temp.getChildren().add(tree); | 290 | temp.getChildren().add(tree); |
291 | - if(!tree.getIsLeaf()) { | 291 | + if(permission.getIsLeaf()==0) { |
292 | getTreeModelList(treeList, metaList, tree); | 292 | getTreeModelList(treeList, metaList, tree); |
293 | } | 293 | } |
294 | } | 294 | } |
@@ -310,12 +310,11 @@ public class SysPermissionController { | @@ -310,12 +310,11 @@ public class SysPermissionController { | ||
310 | JSONObject json = getPermissionJsonObject(permission); | 310 | JSONObject json = getPermissionJsonObject(permission); |
311 | if(parentJson==null && oConvertUtils.isEmpty(tempPid)) { | 311 | if(parentJson==null && oConvertUtils.isEmpty(tempPid)) { |
312 | jsonArray.add(json); | 312 | jsonArray.add(json); |
313 | - if(!permission.isLeaf()) { | 313 | + if(permission.getIsLeaf()==0) { |
314 | getPermissionJsonArray(jsonArray, metaList, json); | 314 | getPermissionJsonArray(jsonArray, metaList, json); |
315 | } | 315 | } |
316 | }else if(parentJson!=null && oConvertUtils.isNotEmpty(tempPid) && tempPid.equals(parentJson.getString("id"))){ | 316 | }else if(parentJson!=null && oConvertUtils.isNotEmpty(tempPid) && tempPid.equals(parentJson.getString("id"))){ |
317 | - //类型( 0:一级菜单 1:子菜单 2:按钮 ) | ||
318 | - if(permission.getMenuType()==2) { | 317 | + if(permission.getMenuType()==0) { |
319 | JSONObject metaJson = parentJson.getJSONObject("meta"); | 318 | JSONObject metaJson = parentJson.getJSONObject("meta"); |
320 | if(metaJson.containsKey("permissionList")) { | 319 | if(metaJson.containsKey("permissionList")) { |
321 | metaJson.getJSONArray("permissionList").add(json); | 320 | metaJson.getJSONArray("permissionList").add(json); |
@@ -324,8 +323,8 @@ public class SysPermissionController { | @@ -324,8 +323,8 @@ public class SysPermissionController { | ||
324 | permissionList.add(json); | 323 | permissionList.add(json); |
325 | metaJson.put("permissionList", permissionList); | 324 | metaJson.put("permissionList", permissionList); |
326 | } | 325 | } |
327 | - //类型( 0:一级菜单 1:子菜单 2:按钮 ) | ||
328 | - }else if(permission.getMenuType()==1|| permission.getMenuType()==0) { | 326 | + |
327 | + }else if(permission.getMenuType()==1) { | ||
329 | if(parentJson.containsKey("children")) { | 328 | if(parentJson.containsKey("children")) { |
330 | parentJson.getJSONArray("children").add(json); | 329 | parentJson.getJSONArray("children").add(json); |
331 | }else { | 330 | }else { |
@@ -334,7 +333,7 @@ public class SysPermissionController { | @@ -334,7 +333,7 @@ public class SysPermissionController { | ||
334 | parentJson.put("children", children); | 333 | parentJson.put("children", children); |
335 | } | 334 | } |
336 | 335 | ||
337 | - if(!permission.isLeaf()) { | 336 | + if(permission.getIsLeaf()==0) { |
338 | getPermissionJsonArray(jsonArray, metaList, json); | 337 | getPermissionJsonArray(jsonArray, metaList, json); |
339 | } | 338 | } |
340 | } | 339 | } |
@@ -406,4 +405,4 @@ public class SysPermissionController { | @@ -406,4 +405,4 @@ public class SysPermissionController { | ||
406 | } | 405 | } |
407 | } | 406 | } |
408 | 407 | ||
409 | -} | 408 | -} |
409 | +} | ||
410 | \ No newline at end of file | 410 | \ No newline at end of file |