|
@@ -23,10 +23,12 @@ import org.springframework.util.StringUtils;
|
|
|
public class SmsServiceV2 {
|
|
|
private static Logger log = LoggerFactory.getLogger("programLog");
|
|
|
|
|
|
- private static final String accessKeyId = "LTAIUrvuHqj8pvry";//你的accessKeyId,参考本文档步骤2
|
|
|
- private static final String accessKeySecret = "JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4";//你的accessKeySecret,参考本文档步骤2
|
|
|
- @Value("${phone.sign:四维看看}")
|
|
|
+ @Value("${sms.ali.sign}")
|
|
|
private String sign;
|
|
|
+ @Value("${sms.ali.accessKey}")
|
|
|
+ private String accessKeyId;
|
|
|
+ @Value("${sms.ali.accessKeySecret}")
|
|
|
+ private String accessKeySecret;
|
|
|
|
|
|
public String sendSms(String phoneNum, String templateParam, String templateCode) throws Exception {
|
|
|
log.info("cnCode:" + templateCode);
|
|
@@ -79,7 +81,7 @@ public class SmsServiceV2 {
|
|
|
* @return Client
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
- public static com.aliyun.dysmsapi20170525.Client createClient() throws Exception {
|
|
|
+ public com.aliyun.dysmsapi20170525.Client createClient() throws Exception {
|
|
|
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
|
|
|
// 必填,您的 AccessKey ID
|
|
|
.setAccessKeyId(accessKeyId)
|