|
|
|
|
@ -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))); |
|
|
|
|
} |
|
|
|
|
|