1.修改 提示租户过期日期,不要具体时间

This commit is contained in:
Wang Chen Chen
2023-11-23 14:37:29 +08:00
parent d4dfe3a484
commit b36247352c

View File

@@ -92,11 +92,11 @@ public class UserLoginServiceImpl implements UserLoginService {
}
// 判断租户状态
if (!Objects.equals(currentTenant.getStatus(), StatusEnum.NORMAL.getCode())) {
throw new JwtAuthException(StrUtil.format("租户 {} 被用!", currentTenant.getName()));
throw new JwtAuthException(StrUtil.format("租户 {} 被用!", currentTenant.getName()));
}
// 判断租户是否过期
if (LocalDateTime.now().isAfter(currentTenant.getExpired())) {
var format = LocalDateTimeUtil.formatNormal(currentTenant.getExpired());
var format = LocalDateTimeUtil.formatNormal(currentTenant.getExpired().toLocalDate());
throw new JwtAuthException(StrUtil.format("租户 {} 已经在 {} 过期了!", currentTenant.getName(), format));
}
// 把表单提交的 username password 封装到 UsernamePasswordAuthenticationToken中