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