Commit ad3b77d1 authored by hezhen's avatar hezhen

123

parent ef4f04d0
......@@ -25,6 +25,8 @@ public class Menu {
private String type;
private String state;
private String description;
@Column(name = "crt_time")
......@@ -167,6 +169,20 @@ public class Menu {
this.type = type;
}
/**
* @return state
*/
public String getState() {
return state;
}
/**
* @param state
*/
public void setState(String state) {
this.state = state;
}
/**
* @return description
*/
......
......@@ -120,8 +120,8 @@ public class UserController extends CommonBaseController {
@RequestMapping(value = "/front/menus", method = RequestMethod.GET)
public @ResponseBody
List<MenuTree> getMenusByUsername(String token) throws Exception {
return permissionService.getMenusByUsername(token);
List<MenuTree> getMenusByUsername(String token,String state) throws Exception {
return permissionService.getMenusByUsername(token,state);
}
@RequestMapping(value = "/front/menu/all", method = RequestMethod.GET)
......
......@@ -170,13 +170,14 @@ public class PermissionService {
return frontUser;
}
public List<MenuTree> getMenusByUsername(String token) throws Exception {
public List<MenuTree> getMenusByUsername(String token,String state) throws Exception {
String username = userAuthUtil.getInfoFromToken(token).getUniqueName();
if (username == null) {
return null;
}
User user = userBiz.getUserByUsername(username);
List<Menu> menus = menuBiz.getUserAuthorityMenuByUserId(user.getId());
menus=menus.stream().filter(a->state.contains(a.getState())).collect(Collectors.toList());
return getMenuTree(menus,AdminCommonConstant.ROOT);
}
}
......@@ -12,6 +12,7 @@
<result column="href" jdbcType="VARCHAR" property="href"/>
<result column="icon" jdbcType="VARCHAR" property="icon"/>
<result column="type" jdbcType="CHAR" property="type"/>
<result column="state" jdbcType="INTEGER" property="state"/>
<result column="description" jdbcType="VARCHAR" property="description"/>
<result column="crt_time" jdbcType="DATE" property="crtTime"/>
<result column="crt_user" jdbcType="VARCHAR" property="crtUser"/>
......
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