短信验证码
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ public class WeChatUserController extends BaseController {
|
||||
if(StrUtil.isEmpty(userVO.getPhone())){
|
||||
return warn("手机号不能为空");
|
||||
}
|
||||
return success(weChatUserService.sendCode(userVO));
|
||||
return weChatUserService.sendCode(userVO);
|
||||
}
|
||||
/**
|
||||
* 小程序注册
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO;
|
||||
public interface WeChatUserService {
|
||||
|
||||
|
||||
String sendCode(WeChatUserVO userVO);
|
||||
AjaxResult sendCode(WeChatUserVO userVO);
|
||||
|
||||
|
||||
AjaxResult registerUser(IdentityAuthentication ientityAuthentication);
|
||||
|
||||
+4
-3
@@ -53,7 +53,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
|
||||
private IdentityAuthenticationMapper identityAuthenticationMapper;
|
||||
|
||||
@Override
|
||||
public String sendCode(WeChatUserVO userVO) {
|
||||
public AjaxResult sendCode(WeChatUserVO userVO) {
|
||||
|
||||
Random random = new Random();
|
||||
String code = "";
|
||||
@@ -69,9 +69,10 @@ public class WeChatUserServiceImpl implements WeChatUserService {
|
||||
Boolean flag = SmsUtils.sendSms(request);
|
||||
if(flag){
|
||||
setCodeCache(userVO.getPhone(),code);
|
||||
return "短信发送成功";
|
||||
return AjaxResult.success("短信发送成功");
|
||||
}else {
|
||||
return AjaxResult.warn("短信发送失败");
|
||||
}
|
||||
return "短信发送失败";
|
||||
}
|
||||
/**
|
||||
* 设置验证码缓存
|
||||
|
||||
Reference in New Issue
Block a user