短信验证码模版+签名使用不对的问题
This commit is contained in:
parent
fe64a32608
commit
aea8f82331
|
|
@ -11,6 +11,7 @@ import com.ruoyi.common.utils.ExceptionUtil;
|
|||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.NoticeRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.asm.Advice;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
|
@ -39,8 +40,8 @@ public class NoticeController {
|
|||
// 工程代码泄露可能会导致AccessKey泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议使用更安全的 STS 方式,更多鉴权访问方式请参见:https://help.aliyun.com/document_detail/378657.html
|
||||
Client client = createClient("LTAI5tLDuQRdfyHASSxehs9m", "CraRUliWZNMJhhSRIZ0nVWrxFkGTOH");
|
||||
SendSmsRequest sendSmsRequest = new SendSmsRequest()
|
||||
.setSignName("保无忧")
|
||||
.setTemplateCode("SMS_275375715")
|
||||
.setSignName("保无忧法律咨询")
|
||||
.setTemplateCode("SMS_268511098")
|
||||
.setPhoneNumbers(request.getPhone())
|
||||
.setTemplateParam("{\"code\":"+ code +"}");
|
||||
RuntimeOptions runtime = new RuntimeOptions();
|
||||
|
|
@ -50,6 +51,7 @@ public class NoticeController {
|
|||
CacheUtils.put(request.getPhone(), code);
|
||||
}catch (Exception e){
|
||||
log.error("给 {} 发送短信失败 {}", request.getPhone(), ExceptionUtil.getExceptionMessage(e));
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
return AjaxResult.success("操作成功!");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue