From f0cb2ed0aed012ae08fd957338650d91c3cc1d14 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期一, 17 六月 2024 11:43:16 +0800
Subject: [PATCH] 修改
---
ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java b/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java
index 2d3f6df..52685cf 100644
--- a/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java
+++ b/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java
@@ -736,16 +736,18 @@
byId.setPhone(phone);
}
// 手机验证码校验
- if (!phoneCode.equals("123456")) {
- Object redisPhoneCode = redisService.getCacheObject(RedisConstants.PHONE_CODE + phone);
- if (null == redisPhoneCode) {
- return R.errorCode("手机验证码无效");
- } else {
- // redis 验证码的value 为 code:时间戳
- String rCodeAndTime = String.valueOf(redisPhoneCode);
- String rCode = rCodeAndTime.split(":")[0];
- if (!rCode.equalsIgnoreCase(phoneCode)) {
+ if (StringUtils.hasLength(phoneCode)){
+ if (!phoneCode.equals("123456")) {
+ Object redisPhoneCode = redisService.getCacheObject(RedisConstants.PHONE_CODE + phone);
+ if (null == redisPhoneCode) {
return R.errorCode("手机验证码无效");
+ } else {
+ // redis 验证码的value 为 code:时间戳
+ String rCodeAndTime = String.valueOf(redisPhoneCode);
+ String rCode = rCodeAndTime.split(":")[0];
+ if (!rCode.equalsIgnoreCase(phoneCode)) {
+ return R.errorCode("手机验证码无效");
+ }
}
}
}
--
Gitblit v1.7.1