This commit is contained in:
parent
0e2fc31463
commit
11d836924c
|
|
@ -125,9 +125,14 @@ public class TokenController {
|
|||
@PostMapping("sendCode")
|
||||
public R<?> sendCode(@RequestBody LoginBody form) {
|
||||
String uuid = form.getUuid();
|
||||
String captcha = redisService.getCacheObject(CacheConstants.CAPTCHA_CODE_KEY + uuid).toString();
|
||||
if (StringUtils.isBlank(captcha)) {
|
||||
return R.fail("验证码超时,请重新刷新");
|
||||
String captcha = "";
|
||||
Object object = redisService.getCacheObject(CacheConstants.CAPTCHA_CODE_KEY + uuid);
|
||||
if (object == null) {
|
||||
// 删除验证码缓存
|
||||
redisService.deleteObject(CacheConstants.CAPTCHA_CODE_KEY + uuid);
|
||||
return R.fail("图形验证码超时,请重新刷新");
|
||||
} else {
|
||||
captcha = object.toString();
|
||||
}
|
||||
if (form.getCode() != null && !form.getCode().equals(captcha)) {
|
||||
return R.fail("验证码错误");
|
||||
|
|
|
|||
Loading…
Reference in New Issue