fix:修改角色菜单
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.nl.sso.system.rest;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -69,9 +70,9 @@ public class RoleController {
|
||||
@PutMapping(value = "/menu")
|
||||
// @SaCheckPermission("roles:edit")
|
||||
public ResponseEntity<Object> updateMenu(@RequestBody JSONObject form) {
|
||||
if (ObjectUtil.isNotEmpty(form)){
|
||||
String role_id = form.getString("role_id");
|
||||
JSONArray menus = form.getJSONArray("menus");
|
||||
|
||||
WQLObject rmTab = WQLObject.getWQLObject("sys_roles_menus");
|
||||
JSONArray result = rmTab.query("role_id = " + role_id + "").getResultJSONArray(0);
|
||||
Set<String> dbMenus = new HashSet<>();
|
||||
@@ -90,7 +91,7 @@ public class RoleController {
|
||||
String collect = needDel.stream().collect(Collectors.joining("','"));
|
||||
rmTab.delete("role_id = '"+role_id+"' and menu_id in ('"+collect+"')");
|
||||
}
|
||||
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user