opt:优化

This commit is contained in:
DESKTOP-5DIJMF9\admin
2025-07-23 16:47:32 +08:00
parent 6129a1f7f1
commit b1d5976bcd

View File

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