feat(auth): WechatAuthServiceImpl 生成 MEMBER 类型 Token,WechatLoginVO 增加 userType

- 微信登录时显式传入 userType=MEMBER 生成 Token
- WechatLoginVO 增加 userType 字段,登录响应返回 userType=MEMBER
This commit is contained in:
张翔
2026-06-03 11:27:47 +08:00
parent 1a58ee63d2
commit 47e9a65497
2 changed files with 6 additions and 2 deletions
@@ -303,9 +303,9 @@ public class WechatAuthServiceImpl implements WechatAuthService {
} }
List<String> roles = new ArrayList<>(); List<String> roles = new ArrayList<>();
String accessToken = jwtTokenProvider.generateToken(String.valueOf(member.getId()), member.getId(), roles); String accessToken = jwtTokenProvider.generateToken(String.valueOf(member.getId()), member.getId(), roles, "MEMBER");
log.info("JWT Token 生成成功, memberId: {}", member.getId()); log.info("JWT Token 生成成功, memberId: {}, userType=MEMBER", member.getId());
int expiresIn = 86400; int expiresIn = 86400;
@@ -316,6 +316,7 @@ public class WechatAuthServiceImpl implements WechatAuthService {
.expiresIn(expiresIn) .expiresIn(expiresIn)
.isNewUser(isNewUser) .isNewUser(isNewUser)
.needCompleteInfo(needCompleteInfo) .needCompleteInfo(needCompleteInfo)
.userType("MEMBER")
.build(); .build();
} }
} }
@@ -35,4 +35,7 @@ public class WechatLoginVO {
// 是否需要补全信息(昵称、手机号等) // 是否需要补全信息(昵称、手机号等)
private Boolean needCompleteInfo; private Boolean needCompleteInfo;
// 用户类型(MEMBER
private String userType;
} }