mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-22 20:54:25 +08:00
Merge branch 'master' into dev
This commit is contained in:
commit
c4a763ac6c
@ -16,6 +16,8 @@
|
||||
|
||||
package com.pig4cloud.pig.auth.endpoint;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.TemporalAccessorUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -213,8 +215,14 @@ public class PigTokenEndpoint {
|
||||
tokenVo.setUsername(authorization.getPrincipalName());
|
||||
OAuth2Authorization.Token<OAuth2AccessToken> accessToken = authorization.getAccessToken();
|
||||
tokenVo.setAccessToken(accessToken.getToken().getTokenValue());
|
||||
tokenVo.setExpiresAt(accessToken.getToken().getExpiresAt());
|
||||
tokenVo.setIssuedAt(accessToken.getToken().getIssuedAt());
|
||||
|
||||
String expiresAt = TemporalAccessorUtil.format(accessToken.getToken().getExpiresAt(),
|
||||
DatePattern.NORM_DATETIME_PATTERN);
|
||||
tokenVo.setExpiresAt(expiresAt);
|
||||
|
||||
String issuedAt = TemporalAccessorUtil.format(accessToken.getToken().getIssuedAt(),
|
||||
DatePattern.NORM_DATETIME_PATTERN);
|
||||
tokenVo.setIssuedAt(issuedAt);
|
||||
return tokenVo;
|
||||
}).collect(Collectors.toList());
|
||||
result.setRecords(tokenVoList);
|
||||
|
@ -2,8 +2,6 @@ package com.pig4cloud.pig.admin.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* 前端展示令牌管理
|
||||
*
|
||||
@ -23,8 +21,8 @@ public class TokenVo {
|
||||
|
||||
private String accessToken;
|
||||
|
||||
private Instant issuedAt;
|
||||
private String issuedAt;
|
||||
|
||||
private Instant expiresAt;
|
||||
private String expiresAt;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user