| | |
| | | /** |
| | | * 获取当前登录用户信息 |
| | | */ |
| | | private static LoginUserInfo getUserDetails() { |
| | | public static LoginUserInfo getUserDetails() { |
| | | final Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); |
| | | if (authentication == null) { |
| | | throw new BusinessException(ResponseStatusEnums.TOKEN_INVALID.getCode(), ResponseStatusEnums.TOKEN_INVALID.getMessage()); |
| | |
| | | if (loginUserInfo == null) { |
| | | return null; |
| | | } |
| | | if (AdministratorEnums.CUSTOMER.getCode().equals(loginUserInfo.getAdministratorType())) { |
| | | if (!AdministratorEnums.ADMIN.getCode().equals(loginUserInfo.getAdministratorType())) { |
| | | return loginUserInfo.getUserId(); |
| | | } |
| | | return null; |