|
@@ -11,7 +11,9 @@ import org.springblade.common.enums.NumberEnum;
|
|
|
import org.springblade.common.utils.RedisUtils;
|
|
|
import org.springblade.common.utils.VerificationCodeUtil;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
+import org.springblade.core.sms.model.SmsResponse;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
+import org.springblade.resource.feign.ISmsClient;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -30,6 +32,8 @@ public class verificationController {
|
|
|
|
|
|
private final RedisUtils redisUtils;
|
|
|
|
|
|
+ private final ISmsClient smsClient;
|
|
|
+
|
|
|
|
|
|
@GetMapping("/getVerificationCodeAction")
|
|
|
@ResponseBody
|
|
@@ -71,6 +75,8 @@ public class verificationController {
|
|
|
}
|
|
|
String code = VerificationCodeUtil.getVerificationCode(NumberEnum.SIX.number);
|
|
|
// TODO: 需要短信发送
|
|
|
+ String params = "TemplateParamSet:[\"" + code + "\"]";
|
|
|
+ R<SmsResponse> responseR = smsClient.sendMessage("tencent-kbs", params, phone);
|
|
|
redisUtils.set(phone, code, NumberEnum.THREE_HUNDRED.number);
|
|
|
return R.success(code);
|
|
|
}
|