1. 修复用户 APP 发送短信验证码报错

This commit is contained in:
YunaiV 2022-02-05 21:20:54 +08:00
parent d649b93017
commit 448aa21e33
4 changed files with 6 additions and 3 deletions

View File

@ -304,7 +304,7 @@ public class MemberAuthServiceImpl implements MemberAuthService {
@Override @Override
public void sendSmsCode(Long userId, AppAuthSendSmsReqVO reqVO) { public void sendSmsCode(Long userId, AppAuthSendSmsReqVO reqVO) {
// TODO 要根据不同的场景校验是否有用户 // TODO 要根据不同的场景校验是否有用户
smsCodeApi.sendSmsCode(AuthConvert.INSTANCE.convert(reqVO)); smsCodeApi.sendSmsCode(AuthConvert.INSTANCE.convert(reqVO).setCreateIp(getClientIP()));
} }
/** /**

View File

@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
/** /**
* 短信验证码的发送 Request DTO * 短信验证码的发送 Request DTO
@ -24,7 +25,7 @@ public class SmsCodeSendReqDTO {
/** /**
* 发送场景 * 发送场景
*/ */
@NotEmpty(message = "发送场景不能为空") @NotNull(message = "发送场景不能为空")
@InEnum(SmsSceneEnum.class) @InEnum(SmsSceneEnum.class)
private Integer scene; private Integer scene;
/** /**

View File

@ -43,7 +43,8 @@ public enum SmsSceneEnum implements IntArrayValuable {
} }
public static SmsSceneEnum getCodeByScene(Integer scene) { public static SmsSceneEnum getCodeByScene(Integer scene) {
return ArrayUtil.firstMatch(sceneEnum -> sceneEnum.getScene().equals(scene)); return ArrayUtil.firstMatch(sceneEnum -> sceneEnum.getScene().equals(scene),
values());
} }
} }

View File

@ -19,6 +19,7 @@ import javax.servlet.http.HttpServletRequest;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
// TODO 芋艿这块的接口命名在纠结下
@Api(tags = "管理后台 - 短信回调") @Api(tags = "管理后台 - 短信回调")
@RestController @RestController
@RequestMapping("/system/sms/callback") @RequestMapping("/system/sms/callback")