发送短信

pull/1/head
liushaodong 5 years ago
parent d43cc68b0c
commit edc44a20a5
  1. 15
      blockchain-server/blockchain-server-user/src/main/java/com/blockchain/server/user/common/utils/SendSmsgCode.java
  2. 2
      spring-cloud/spring-cloud-config/src/main/resources/properties/smsconf-dev.yml

@ -1,4 +1,4 @@
package com.blockchain.server.user.common.utils; package com.blockchain.server.system.common.util;
import lombok.Data; import lombok.Data;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -65,18 +65,12 @@ public class SendSmsgCode {
requestEntity.add("Account", Account); requestEntity.add("Account", Account);
requestEntity.add("Pwd", Pwd); requestEntity.add("Pwd", Pwd);
requestEntity.add("Content", smsCode); requestEntity.add("Content", smsCode);
requestEntity.add("Mobile", internationalCode + mobile);
//国内手机 //国内手机
if (CHINA_CODE.equals(internationalCode)) { if (CHINA_CODE.equals(internationalCode)) {
requestEntity.add("Mobile", mobile); // requestEntity.add("Mobile", mobile);
requestEntity.add("TemplateId", TemplateId_ZH_CN); requestEntity.add("TemplateId", TemplateId_ZH_CN);
requestEntity.add("SignId", SignId_ZH_CN); requestEntity.add("SignId", SignId_ZH_CN);
try {
ResponseEntity<String> res = restTemplate.postForEntity(URL, requestEntity, String.class);
LOG.info("===send sms end==== : {} ", res);
} catch (Exception e) {
e.printStackTrace();
}
} else { } else {
//国际代码 //国际代码
if (BIG5_CODE.contains(internationalCode)) { if (BIG5_CODE.contains(internationalCode)) {
@ -86,14 +80,13 @@ public class SendSmsgCode {
requestEntity.add("SignId", SignId_EN_US); requestEntity.add("SignId", SignId_EN_US);
requestEntity.add("TemplateId", TemplateId_EN_US); requestEntity.add("TemplateId", TemplateId_EN_US);
} }
}
try { try {
ResponseEntity<String> res = restTemplate.postForEntity(URL, requestEntity, String.class); ResponseEntity<String> res = restTemplate.postForEntity(URL, requestEntity, String.class);
LOG.info("===send sms end==== : {} ", res); LOG.info("===send sms end==== : {} ", res);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
}
} }

@ -4,7 +4,7 @@ feigesms:
#国内短信接口 #国内短信接口
URL: http://api.feige.ee/SmsService/Inter URL: http://api.feige.ee/SmsService/Inter
Account: 18818574533 Account: 18818574533
Pwd: zxc2019 Pwd: 18680fdeaca3c374c2fe276f5
TemplateId_ZH_CN: 38129 TemplateId_ZH_CN: 38129
SignId_ZH_CN: 38944 SignId_ZH_CN: 38944
TemplateId_ZH_HK: 38120 TemplateId_ZH_HK: 38120

Loading…
Cancel
Save