代码可复用
* 发送自定义参数短信
* @param phone
* @param templateCode
* @param params
* @throws ClientException
*/
public static void sendMsg(String phone, String templateCode, HashMap<String,String> params) throws ClientException {
System.out.println("开始发送短信!");
System.setProperty("sun.net.client.defaultConnectTimeout", "20000");
System.setProperty("sun.net.client.defaultReadTimeout", "20000");
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", ACCESSKEYID, ACCESSKEYSECRET);
DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", "Dysmsapi", "dysmsapi.aliyuncs.com");
IAcsClient acsClient = new DefaultAcsClient(profile);
//组装请求对象
SendSmsRequest request = new SendSmsRequest();
request.setPhoneNumbers(phone);
//必填:短信签名-可在短信控制台中找到
requ