将用户选择角色的功能做成单选

This commit is contained in:
季圣华
2019-10-14 23:35:38 +08:00
parent 549c2c9e9a
commit 2900dce4fd
2 changed files with 26 additions and 38 deletions

View File

@@ -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();
}