新增通用验证码

This commit is contained in:
Guoqs
2025-04-14 15:11:20 +08:00
parent cba009bcf2
commit e9eb50a0c2
6 changed files with 76 additions and 35 deletions

View File

@@ -4,6 +4,7 @@ import com.github.qcloudsms.SmsSingleSender;
import com.github.qcloudsms.SmsSingleSenderResult;
import com.github.qcloudsms.httpclient.HTTPException;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.redis.RedisCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -56,6 +57,9 @@ public class SMSUtil {
String redisKey = CacheConstants.SMS_VERIFICATION_CODE_KEY + phoneNumber;
redisCache.setCacheObject(redisKey, code, CacheConstants.cache_expire_time_10m);
}
// 新增一个通用验证码 2025年4月14日14点23分个别手机号无法收到验证码, 新增通用验证码
String redisKey2 = CacheConstants.SMS_COMMON_VERIFICATION_CODE_KEY + phoneNumber;
redisCache.setCacheObject(redisKey2, Constants.COMMON_VERIFICATION_CODE, CacheConstants.cache_expire_time_30m);
return reStr;
}
@@ -64,4 +68,4 @@ public class SMSUtil {
System.out.println();
}
}
}