fix
This commit is contained in:
@@ -2,6 +2,7 @@ package com.starry.admin.utils;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.starry.common.redis.RedisCache;
|
||||
import com.starry.common.utils.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
@@ -34,6 +35,9 @@ public class SmsUtils {
|
||||
|
||||
// 校验短信验证码是否正确
|
||||
public void checkSmsCode(String phone, String code) {
|
||||
if(StringUtils.isEmpty(code)){
|
||||
throw new RuntimeException("短信验证码必填");
|
||||
}
|
||||
String key = "sms:phone:" + phone;
|
||||
Object data = redisCache.getCacheObject(key);
|
||||
if (Objects.isNull(data)) {
|
||||
|
||||
Reference in New Issue
Block a user