Browse Source

外网验证码api替换

master
21819 2 years ago
parent
commit
ca1b3a18d1
  1. 4
      mailbox-outer/src/main/java/com/biutag/outer/controller/SmsController.java

4
mailbox-outer/src/main/java/com/biutag/outer/controller/SmsController.java

@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONObject;
import com.biutag.core.AjaxResult;
import com.biutag.outer.util.CodeUtil;
import com.biutag.outer.util.Sms;
import com.biutag.outer.util.SmsSend;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -22,7 +23,8 @@ public class SmsController {
public AjaxResult<JSONObject> sendCode(@RequestParam String phone) {
String code = String.valueOf(1000 + random.nextInt(9000));
// 发送短信
Sms.send(phone, code);
// Sms.send(phone, code);
SmsSend.sendSms(phone,code);
// 设置缓存
return AjaxResult.success(JSONObject.of("requestId", CodeUtil.set(code)));
}

Loading…
Cancel
Save