This commit is contained in:
hucs
2024-07-30 11:01:22 +08:00
parent f48e2d8fe4
commit 83922fdf31
3 changed files with 11 additions and 3 deletions

View File

@@ -33,6 +33,7 @@ import com.starry.admin.modules.weichat.entity.order.PlayClerkOrderInfoQueryVo;
import com.starry.admin.modules.weichat.entity.order.PlayClerkOrderListReturnVo; import com.starry.admin.modules.weichat.entity.order.PlayClerkOrderListReturnVo;
import com.starry.admin.modules.weichat.service.WxCustomUserService; import com.starry.admin.modules.weichat.service.WxCustomUserService;
import com.starry.admin.utils.SecurityUtils; import com.starry.admin.utils.SecurityUtils;
import com.starry.admin.utils.SmsUtils;
import com.starry.common.redis.RedisCache; import com.starry.common.redis.RedisCache;
import com.starry.common.result.R; import com.starry.common.result.R;
import com.starry.common.utils.ConvertUtil; import com.starry.common.utils.ConvertUtil;
@@ -100,6 +101,8 @@ public class WxClerkController {
@Resource @Resource
private IPlayPersonnelGroupInfoService playPersonnelGroupInfoService; private IPlayPersonnelGroupInfoService playPersonnelGroupInfoService;
@Resource
private SmsUtils smsUtils;
/** /**
@@ -198,6 +201,8 @@ public class WxClerkController {
if (entity != null) { if (entity != null) {
throw new CustomException("已有申请未审核"); throw new CustomException("已有申请未审核");
} }
smsUtils.checkSmsCode(vo.getPhone(), vo.getSmsCode());
entity = ConvertUtil.entityToVo(vo, PlayClerkUserReviewInfoEntity.class); entity = ConvertUtil.entityToVo(vo, PlayClerkUserReviewInfoEntity.class);
entity.setReviewState("0"); entity.setReviewState("0");
entity.setClerkId(clerkId); entity.setClerkId(clerkId);
@@ -378,9 +383,6 @@ public class WxClerkController {
} }
/** /**
* 店员分页查询本人订单列表 * 店员分页查询本人订单列表
* *

View File

@@ -93,4 +93,6 @@ public class PlayClerkUserByWxAddVo {
*/ */
private String remark; private String remark;
private String smsCode;
} }

View File

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