| | |
| | | default OAuth2OpenAccessTokenRespVO convert(OAuth2AccessTokenDO bean) { |
| | | OAuth2OpenAccessTokenRespVO respVO = BeanUtils.toBean(bean, OAuth2OpenAccessTokenRespVO.class); |
| | | respVO.setTokenType(SecurityFrameworkUtils.AUTHORIZATION_BEARER.toLowerCase()); |
| | | respVO.setExpiresIn(OAuth2Utils.getExpiresIn(bean.getExpiresTime())); |
| | | respVO.setScope(OAuth2Utils.buildScopeStr(bean.getScopes())); |
| | | return respVO; |
| | | } |
| | | |
| | | default OAuth2OpenCheckTokenRespVO convert2(OAuth2AccessTokenDO bean) { |
| | | OAuth2OpenCheckTokenRespVO respVO = BeanUtils.toBean(bean, OAuth2OpenCheckTokenRespVO.class); |
| | | respVO.setExp(LocalDateTimeUtil.toEpochMilli(bean.getExpiresTime()) / 1000L); |
| | | respVO.setExp(LocalDateTimeUtil.toEpochMilli(bean.getExpiresTime())); |
| | | respVO.setUserType(UserTypeEnum.ADMIN.getValue()); |
| | | return respVO; |
| | | } |