linhw 2024-06-12 11:14:59 +08:00
parent 378b779e63
commit 9ca1544495
1 changed files with 8 additions and 5 deletions

View File

@ -160,11 +160,14 @@ public class AppLoginController {
Assert.notNull(appUser, "手机号未注册");
}
// Object cacheObject = redisService.getCacheObject(loginForm.getPhoneNumber());
// if (cacheObject != null) {
// String code = (String) cacheObject;
// Assert.isTrue(code.equals(loginForm.getCode()), "验证码错误");
// }
Object cacheObject = redisService.getCacheObject(loginForm.getPhoneNumber());
if (cacheObject != null) {
String code = (String) cacheObject;
if (!code.equals(loginForm.getCode())) {
return R.fail(201, "验证码错误!");
}
//Assert.isTrue(code.equals(loginForm.getCode()), "验证码错误");
}
String token = IdUtils.fastUUID();
LoginUser loginUser = new LoginUser();
loginUser.setUsername(appUser.getUsername());