将用户选择角色的功能做成单选
This commit is contained in:
@@ -41,13 +41,6 @@ public class RoleController {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Role> dataList = roleService.findUserRole();
|
||||
//开始拼接json数据
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("id", 1);
|
||||
outer.put("text", "角色列表");
|
||||
outer.put("state", "open");
|
||||
//存放数据json数组
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != dataList) {
|
||||
for (Role role : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
@@ -63,12 +56,9 @@ public class RoleController {
|
||||
if (flag == true) {
|
||||
item.put("checked", true);
|
||||
}
|
||||
//结束
|
||||
dataArray.add(item);
|
||||
arr.add(item);
|
||||
}
|
||||
}
|
||||
outer.put("children", dataArray);
|
||||
arr.add(outer);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user