|
@@ -20,7 +20,8 @@ public class MobileMessageUtils {
|
|
|
|
|
|
|
|
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", accessKey, accessSecret);
|
|
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", accessKey, accessSecret);
|
|
|
try {
|
|
try {
|
|
|
- DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", "Dysmsapi", "dysmsapi.aliyuncs.com");
|
|
|
|
|
|
|
+ throw new ClientException("短信异常");
|
|
|
|
|
+/* DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", "Dysmsapi", "dysmsapi.aliyuncs.com");
|
|
|
IAcsClient acsClient = new DefaultAcsClient(profile);
|
|
IAcsClient acsClient = new DefaultAcsClient(profile);
|
|
|
// 组装请求对象
|
|
// 组装请求对象
|
|
|
SendSmsRequest request = new SendSmsRequest();
|
|
SendSmsRequest request = new SendSmsRequest();
|
|
@@ -41,12 +42,12 @@ public class MobileMessageUtils {
|
|
|
// request.setOutId("yourOutId");
|
|
// request.setOutId("yourOutId");
|
|
|
// 请求失败这里会抛ClientException异常
|
|
// 请求失败这里会抛ClientException异常
|
|
|
SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request);
|
|
SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request);
|
|
|
- } catch (ClientException e) {
|
|
|
|
|
|
|
+*/ } catch (ClientException e) {
|
|
|
LoggerUtils.fmtError(MobileMessageUtils.class, e, CLIENT_EXCEPTION, e.getMessage());
|
|
LoggerUtils.fmtError(MobileMessageUtils.class, e, CLIENT_EXCEPTION, e.getMessage());
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
return "短信异常!";
|
|
return "短信异常!";
|
|
|
- }
|
|
|
|
|
- return null;
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+// return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|