This commit is contained in:
zhouwentao 2024-03-20 10:36:59 +08:00
parent afebf72f46
commit dfd1990d0f
1 changed files with 2 additions and 2 deletions

View File

@ -100,7 +100,7 @@ public class MiniUserController {
}
//2. 校验用户名或密码是否正确
String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
String userpassword = PasswordUtil.encrypt(sysUser.getUsername(), password, sysUser.getSalt());
String syspassword = sysUser.getPassword();
if (!syspassword.equals(userpassword)) {
result.error500("用户名或密码错误");
@ -109,7 +109,7 @@ public class MiniUserController {
//用户登录信息
//1.生成token
String token = JwtUtil.sign(username, syspassword);
String token = JwtUtil.sign(sysUser.getUsername(), syspassword);
// 设置token缓存有效时间
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 2 / 1000);