Skip to content

Commit aea7453

Browse files
committed
perf: 代码优化
1 parent 1c3317f commit aea7453

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

simple-common/src/main/java/top/cadecode/common/util/TokenUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ public class TokenUtil {
3434
/**
3535
* 生成 token
3636
*
37-
* @param id 用户 ID
37+
* @param id 用户 ID
3838
* @param roles 角色
3939
* @return token 字符串
4040
*/
4141
public String generateToken(long id, List<String> roles) {
42-
long expiredTime = new Date().getTime() + expiration * 1000;
42+
long expiredTime = System.currentTimeMillis() + expiration * 1000;
4343
JWSHeader jwsHeader = new JWSHeader(JWSAlgorithm.HS256);
4444
JWTClaimsSet jwtClaimsSet = new JWTClaimsSet.Builder()
4545
.claim("id", id).

0 commit comments

Comments
 (0)