|
|
@@ -77,9 +77,10 @@ public class AuthController {
|
|
|
if (!companyDTO.isPresent()) {
|
|
|
return Result.error(ExceptionCode.USER_NOT_ENABLE);
|
|
|
}
|
|
|
+ Long companyId = companyDTO.get().getId();
|
|
|
String appId = "operation";
|
|
|
|
|
|
- JwtInfo info = new JwtInfo(appId, companyDTO.get().getId(), accountDTO.getId(), accountDTO.getUsername(), accountDTO.getRealname());
|
|
|
+ JwtInfo info = new JwtInfo(appId, companyId, accountDTO.getId(), accountDTO.getUsername(), accountDTO.getRealname());
|
|
|
JwtToken jwtToken = JwtHelper.generateToken(info, authConfig.getPrivateKey(), authConfig.getExpire());
|
|
|
TokenDTO tokenDTO = BeanMapper.map(jwtToken, TokenDTO.class);
|
|
|
// 登录成功记入redis
|
|
|
@@ -89,7 +90,7 @@ public class AuthController {
|
|
|
authorizeLogService.save(AuthorizeLog.from(request)
|
|
|
.setAccountId(accountDTO.getId())
|
|
|
.setAppId(appId).build());
|
|
|
- return Result.success(new AuthDTO(tokenDTO, accountDTO));
|
|
|
+ return Result.success(new AuthDTO(tokenDTO, accountDTO, companyId));
|
|
|
} else {
|
|
|
// 失败次数超过最大限制
|
|
|
if (authorizeCountService.increaseAndGet(username) > authConfig.getMaxErrors()) {
|