浏览代码

fix短信验证校验

Eric 1 年之前
父节点
当前提交
8aa9684148

+ 13 - 12
cooleshow-common/src/main/java/com/yonge/cooleshow/common/service/impl/RedisIdGeneratorService.java

@@ -98,19 +98,20 @@ public class RedisIdGeneratorService implements IdGeneratorService {
 
 	@Override
 	public boolean verifyValidCode(String mobile, String authCode,String keyEnum) {
-		if (debugMode || this.authCode) {
-			if (defaultPwd.equals(authCode)) {
-				return true;
-			}
-		} else {
-			String key = "verificationCode" + keyEnum + mobile;
-			Object object = redisCache.get(key);
-			log.info("*********************mobile:{} smsCode:{} inutCode:{}******************", key, object, authCode);
-			String verifyCode = object == null ? null : object.toString();
-			if (StringUtils.isNoneEmpty(verifyCode) && StringUtils.equalsIgnoreCase(verifyCode, authCode)) {
-				return true;
-			}
+
+		// 本地调试模式
+		if ((debugMode || this.authCode) && StringUtils.equalsIgnoreCase(defaultPwd, authCode)) {
+			return true;
+		}
+
+		String key = "verificationCode" + keyEnum + mobile;
+		Object object = redisCache.get(key);
+		log.info("*********************mobile:{} smsCode:{} inutCode:{}******************", key, object, authCode);
+		String verifyCode = object == null ? null : object.toString();
+		if (StringUtils.isNoneEmpty(verifyCode) && StringUtils.equalsIgnoreCase(verifyCode, authCode)) {
+			return true;
 		}
+
 		return false;
 	}