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