手持登入token前缀修改
This commit is contained in:
@@ -57,7 +57,7 @@ public class MobileAuthorizationController {
|
|||||||
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, authUser.getPassword());
|
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"))) { // 这里需要密码加密
|
if (userDto==null||!userDto.getPassword().equals(SaSecureUtil.md5BySalt(password, "salt"))) { // 这里需要密码加密
|
||||||
throw new BadRequestException("账号或密码错误");
|
throw new BadRequestException("账号或密码错误");
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ public class MobileAuthorizationController {
|
|||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("user", userDto);
|
jsonObject.put("user", userDto);
|
||||||
Map<String, Object> authInfo = new HashMap<String, Object>(2) {{
|
Map<String, Object> authInfo = new HashMap<String, Object>(2) {{
|
||||||
put("token","Bearer "+ StpUtil.getTokenValue());
|
put("token", StpUtil.getTokenValue());
|
||||||
put("user", jsonObject);
|
put("user", jsonObject);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user