Commit d95d9eac authored by 赵啸非's avatar 赵啸非

添加菜单资源配置

parent d6043b2c
......@@ -26,7 +26,7 @@ public class MenuVo extends BaseEntityLong {
private Integer type;
/**
* 是否选中,0为选中,1选中。默认0
* 是否选中,0为选中,1选中。默认0
*/
private Integer checked=0;
private Integer checked;
}
\ No newline at end of file
......@@ -247,18 +247,25 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity
*/
private void recursionFn(List<MenuEntity> list, MenuEntity t, Set<Long> menuIdsChecked) {
// 得到子节点列表
updateChecked(menuIdsChecked, t);
List<MenuEntity> childList = getChildList(list, t);
t.setChildren(childList);
for (MenuEntity tChild : childList) {
if (menuIdsChecked.contains(tChild.getId())) {
tChild.setChecked(YesNoEnum.YES.getValue());
}
updateChecked(menuIdsChecked, tChild);
if (hasChild(list, tChild)) {
recursionFn(list, tChild, menuIdsChecked);
}
}
}
private void updateChecked(Set<Long> menuIdsChecked, MenuEntity menu) {
if (menuIdsChecked.contains(menu.getId())) {
menu.setChecked(YesNoEnum.YES.getValue());
} else {
menu.setChecked(YesNoEnum.NO.getValue());
}
}
@Override
protected void removeBefore(Long[] ids, Context context) throws AppException {
//有子节点 禁止删除
......
......@@ -4,7 +4,7 @@
"baseLogin": "http://127.0.0.1:18222/m"
},
"test": {
"baseUrl": "http://8.136.255.30:11078/bill",
"baseUrl": "http://192.168.0.250:11078/bill",
"baseLogin": "http://192.168.0.98:11078/base"
},
......
......@@ -4,8 +4,8 @@ POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"xinhx",
"password":"xhxADMIN8@a"
"loginName":"admin",
"password":"admin"
}
> {%
......@@ -101,6 +101,16 @@ Content-Type: application/json
}
###针对某一接入
POST {{baseUrl}}/role/auth/editMenu
Authorization: {{authToken}}
Content-Type: application/json
{
"roleId": 2
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment