示例代码
String telephone = formData.get("phone");
JSONObject json = null;
// 生成6位验证码
String verifyCode = String.valueOf(new Random().nextInt(899999) + 100000);
json = new JSONObject();
json.put("verifyCode", verifyCode);
json.put("createTime", System.currentTimeMillis());
json.put("phone", telephone);
WxSessionUtil.setCodeKey(token, json.toString());
System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
System.setProperty("sun.net.client.defaultReadTimeout", "10000");
//**阿里用户ak aks**
String accessKeyId = PropertiesUtils.getInstance().getProperty(Constants.ALI_AK);
String ali_accessKeySecret = PropertiesUtils.getInstance().getProperty(Constants.ALI_AKS);
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", accessKeyId, ali_accessKeySecret);
DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", "Dysmsapi", "dysmsapi.aliyuncs.com");
IAcsClient acsClient = new DefaultAcsClient(profile);
// 组装请求对象-具体描述见控制台-文档部分内容
SendSmsRequest requestSms = new SendSmsRequest();
// 必填:待发送手机号
requestSms.setPhoneNumbers(telephone);
String signName = PropertiesUtils.getInstance().getProperty(Constants.ALI_SIGNNAME);
String templateCode = PropertiesUtils.getInstance().getProperty(Constants.ALI_TEMPLATECODE);