| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | |
| | | if (CollectionUtils.isEmpty(roles)) { |
| | | return AjaxResult.error("请关联角色!"); |
| | | } |
| | | |
| | | Optional<SysRole> any = roles.stream().filter(role -> role.getAppletFlag().equals(1)).findAny(); |
| | | if (any.isPresent()) { |
| | | return AjaxResult.error("小程序用户不能登录管理后台!"); |
| | | } |
| | | List<SysMenu> menus = roleService.roleInfoFromUserId(loginUser.getUserId()); |
| | | |
| | | Set<Long> permissions = roleService.getMenuIdSets(loginUser.getUserId()); |
| | | ajax.put("menus", menus); |
| | | ajax.put("userInfo", loginUser); |
| | | ajax.put("permissions", permissions); |
| | | return ajax; |
| | | } |
| | | |