再Menu的实体类POJO中
/**
*根据请求url判断用户的角色
*/
@ApiModelProperty("角色列表 ")
@TableField(exist = false)
private List<Role> roles;
写一个拦截器 CustomFilte 根据请求的url分析请求所需的角色
@Component
public class CustomFilter implements FilterInvocationSecurityMetadataSource {
@Autowired
private IMenuService menuService;
AntPathMatcher antPathMatcher = new AntPathMatcher();
@Override
public Collection<ConfigAttribute> getAttrib