Skip to content

Commit e1aadae

Browse files
committed
[代码优化](v2.6):bug fix
close elunez#544
1 parent 35b821d commit e1aadae

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

eladmin-system/src/main/java/me/zhengjie/modules/security/security/TokenProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class TokenProvider implements InitializingBean {
4343

4444
private final SecurityProperties properties;
4545
private final RedisUtils redisUtils;
46-
public static final String AUTHORITIES_KEY = "auth";
46+
public static final String AUTHORITIES_KEY = "user";
4747
private JwtParser jwtParser;
4848
private JwtBuilder jwtBuilder;
4949

@@ -74,6 +74,7 @@ public String createToken(Authentication authentication) {
7474
return jwtBuilder
7575
// 加入ID确保生成的 Token 都不一致
7676
.setId(IdUtil.simpleUUID())
77+
.claim(AUTHORITIES_KEY, authentication.getName())
7778
.setSubject(authentication.getName())
7879
.compact();
7980
}

0 commit comments

Comments
 (0)