We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c3317f commit aea7453Copy full SHA for aea7453
1 file changed
simple-common/src/main/java/top/cadecode/common/util/TokenUtil.java
@@ -34,12 +34,12 @@ public class TokenUtil {
34
/**
35
* 生成 token
36
*
37
- * @param id 用户 ID
+ * @param id 用户 ID
38
* @param roles 角色
39
* @return token 字符串
40
*/
41
public String generateToken(long id, List<String> roles) {
42
- long expiredTime = new Date().getTime() + expiration * 1000;
+ long expiredTime = System.currentTimeMillis() + expiration * 1000;
43
JWSHeader jwsHeader = new JWSHeader(JWSAlgorithm.HS256);
44
JWTClaimsSet jwtClaimsSet = new JWTClaimsSet.Builder()
45
.claim("id", id).
0 commit comments