| | |
| | | String templateParas = "[\""+code+"\"]"; //模板变量,此处以单变量验证码短信为例,请客户自行生成6位验证码,并定义为字符串类型,以杜绝首位0丢失的问题(例如:002569变成了2569)。 |
| | | |
| | | //请求Body,不携带签名名称时,signature请填null |
| | | String body = buildRequestBody("8823121426646", receiver, "767ad27dce184a32a4b4863517fbd301", |
| | | String body = buildRequestBody("8824110423893", receiver, "767ad27dce184a32a4b4863517fbd301", |
| | | templateParas, statusCallBack, "心泉智慧"); |
| | | if (null == body || body.isEmpty()) { |
| | | LOGGER.warn("body is null."); |
| | |
| | | request.setKey("dFbKS778KG0jvQrQ672b9RaOktfV"); |
| | | request.setSecret("3QsteXCIY3KRfgXf5zXyi6f3cHBj"); |
| | | request.setMethod("POST"); |
| | | request.setUrl("https://smsapi.cn-north-4.myhuaweicloud.com:443/sms/batchSendSms/v1"); |
| | | request.setUrl("https://smsapi.cn-south-1.myhuaweicloud.com:443/sms/batchSendSms/v1"); |
| | | request.addHeader("Content-Type", "application/x-www-form-urlencoded"); |
| | | request.setBody(body); |
| | | LOGGER.info("Print the body: {}", body); |