修复使用jwt后导致的用户管理功能异常

This commit is contained in:
648540858
2023-04-15 09:03:41 +08:00
parent d46fc9de82
commit cf1696e0d6
9 changed files with 29 additions and 122 deletions

View File

@@ -57,7 +57,7 @@ public class UserController {
if (user == null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "用户名或密码错误");
}else {
String jwt = JwtUtils.createToken(username, password);
String jwt = JwtUtils.createToken(username, password, user.getRole().getId());
response.setHeader(JwtUtils.getHeader(), jwt);
user.setAccessToken(jwt);
}