Bladeren bron

优化updateTime

zhou-hao 7 jaren geleden
bovenliggende
commit
0e40738db0

+ 0 - 1
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/OAuth2AccessToken.java

@@ -24,7 +24,6 @@ import javax.validation.constraints.NotNull;
 import java.util.Set;
 
 /**
- * TODO 完成注释
  *
  * @author zhouhao
  */

+ 2 - 0
hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-simple/src/main/java/org/hswebframework/web/service/oauth2/server/simple/SimpleAccessTokenService.java

@@ -88,6 +88,7 @@ public class SimpleAccessTokenService implements AccessTokenService {
                 .where("clientId", token.getClientId())
                 .and("grantType", token.getGrantType())
                 .and("ownerId", token.getOwnerId()).total();
+        token.setUpdateTime(System.currentTimeMillis());
         if (total > 0) {
             DefaultDSLUpdateService
                     .createUpdate(oAuth2AccessDao, token)
@@ -96,6 +97,7 @@ public class SimpleAccessTokenService implements AccessTokenService {
                     .and("ownerId", token.getOwnerId())
                     .exec();
         } else {
+            token.setCreateTime(System.currentTimeMillis());
             oAuth2AccessDao.insert(((OAuth2AccessEntity) token));
         }