手持登入token前缀修改

This commit is contained in:
zhangzhiqiang
2022-12-30 16:59:49 +08:00
parent 390066178d
commit 6c09f8a94b

View File

@@ -57,7 +57,7 @@ public class MobileAuthorizationController {
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, authUser.getPassword());
// 校验数据库
// 根据用户名查询,在比对密码
SysUser userDto = userService.getOne(new QueryWrapper<SysUser>().eq("name", authUser.getUsername()));// 拿不到已经抛出异常
SysUser userDto = userService.getOne(new QueryWrapper<SysUser>().eq("username", authUser.getUsername()));// 拿不到已经抛出异常
if (userDto==null||!userDto.getPassword().equals(SaSecureUtil.md5BySalt(password, "salt"))) { // 这里需要密码加密
throw new BadRequestException("账号或密码错误");
}
@@ -82,7 +82,7 @@ public class MobileAuthorizationController {
JSONObject jsonObject = new JSONObject();
jsonObject.put("user", userDto);
Map<String, Object> authInfo = new HashMap<String, Object>(2) {{
put("token","Bearer "+ StpUtil.getTokenValue());
put("token", StpUtil.getTokenValue());
put("user", jsonObject);
}};