|
@ -40,7 +40,7 @@ import java.util.Map; |
|
|
*/ |
|
|
*/ |
|
|
@Slf4j |
|
|
@Slf4j |
|
|
@RestController |
|
|
@RestController |
|
|
@RequestMapping("/api/bigScreenScreen") |
|
|
@RequestMapping("/mobile/auth") |
|
|
public class MobileAuthorizationController { |
|
|
public class MobileAuthorizationController { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ISysUserService userService; |
|
|
private ISysUserService userService; |
|
@ -51,9 +51,13 @@ public class MobileAuthorizationController { |
|
|
@SaIgnore |
|
|
@SaIgnore |
|
|
//("手持登陆验证")
|
|
|
//("手持登陆验证")
|
|
|
public ResponseEntity<Object> handLogin(@RequestBody Map<String, String> whereJson) { |
|
|
public ResponseEntity<Object> handLogin(@RequestBody Map<String, String> whereJson) { |
|
|
SysUser userInfo = userService.getOne(new QueryWrapper<SysUser>().eq("username", whereJson.get("user"))); |
|
|
SysUser userInfo = userService.getOne(new QueryWrapper<SysUser>().eq("username", whereJson.get("username"))); |
|
|
if (userInfo == null || !userInfo.getPassword().equals(SaSecureUtil.md5BySalt(RsaUtils.decryptByPrivateKey(RsaUtils.KEY, whereJson.get("password")), "salt"))) { // 这里需要密码加密
|
|
|
if (userInfo == null) { // 这里需要密码加密
|
|
|
throw new BadRequestException("账号或密码错误"); |
|
|
throw new BadRequestException("用户不存在"); |
|
|
|
|
|
} |
|
|
|
|
|
String now = SaSecureUtil.md5BySalt(RsaUtils.decryptByPrivateKey(RsaUtils.KEY, whereJson.get("password")), "salt"); |
|
|
|
|
|
if (!userInfo.getPassword().equals(now)) { |
|
|
|
|
|
throw new BadRequestException("密码错误"); |
|
|
} |
|
|
} |
|
|
if (!userInfo.getIs_used()) { |
|
|
if (!userInfo.getIs_used()) { |
|
|
throw new BadRequestException("账号未激活"); |
|
|
throw new BadRequestException("账号未激活"); |
|
|