|
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
+import com.google.gson.Gson;
|
|
|
import com.ydtech.constants.InsuranceImageEnum;
|
|
import com.ydtech.constants.InsuranceImageEnum;
|
|
|
import com.ydtech.constants.SysConstants;
|
|
import com.ydtech.constants.SysConstants;
|
|
|
import com.ydtech.constants.sys.SysPasswordEnum;
|
|
import com.ydtech.constants.sys.SysPasswordEnum;
|
|
@@ -314,26 +315,25 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
|
// redisTemplate.opsForValue().set(PHONE_VERIFICATION_CODE_KEY + phone, String.valueOf(randNumber), PHONE_VERIFICATION_CODE_KEY_TIME
|
|
// redisTemplate.opsForValue().set(PHONE_VERIFICATION_CODE_KEY + phone, String.valueOf(randNumber), PHONE_VERIFICATION_CODE_KEY_TIME
|
|
|
// , TimeUnit.MINUTES);
|
|
// , TimeUnit.MINUTES);
|
|
|
|
|
|
|
|
|
|
+ // 构建 vars
|
|
|
|
|
+ Map<String, String> varsMap = new HashMap<>();
|
|
|
|
|
+ varsMap.put("timeCreated", timeCreate);
|
|
|
|
|
+ varsMap.put("type", type1);
|
|
|
|
|
+ varsMap.put("url", httpUrl + "userId=" + userId + "&remark=" + sysUserTrack.getApproveMess() + "&type=" + type1);
|
|
|
|
|
+ // 将 vars 转换为 JSON 字符串
|
|
|
|
|
+ Gson gson = new Gson();
|
|
|
|
|
+ String varsJson = gson.toJson(varsMap);
|
|
|
String result = null;
|
|
String result = null;
|
|
|
String urlNet = "http://v.juhe.cn/sms/send";//请求接口地址
|
|
String urlNet = "http://v.juhe.cn/sms/send";//请求接口地址
|
|
|
Map params = new HashMap();//请求参数
|
|
Map params = new HashMap();//请求参数
|
|
|
params.put("mobile", phone);//接收短信的手机号码
|
|
params.put("mobile", phone);//接收短信的手机号码
|
|
|
params.put("tpl_id", "265910");//短信模板ID,请参考个人中心短信模板设置
|
|
params.put("tpl_id", "265910");//短信模板ID,请参考个人中心短信模板设置
|
|
|
- String userIdVal = "#userId#=" + userId;
|
|
|
|
|
- params.put("user_id", userIdVal);
|
|
|
|
|
- String timeCreateVal = "#timeCreate#=" + timeCreate;
|
|
|
|
|
- params.put("timeCreate", timeCreateVal);
|
|
|
|
|
- String apprveMess ="#apprveMess#" + sysUserTrack.getApproveMess();
|
|
|
|
|
- params.put("apprveMess", apprveMess);
|
|
|
|
|
- String type2 = "#type#=" + type1;
|
|
|
|
|
- params.put("type", type2);
|
|
|
|
|
- String url ="#url#=" + httpUrl +"userId=" + userId +'&'+ "remark=" +sysUserTrack.getApproveMess() +'&'+"type="+ type;
|
|
|
|
|
- params.put("url", url);
|
|
|
|
|
|
|
+ params.put("vars",varsJson);
|
|
|
params.put("key", "fbe7b165e9e13e52f3b1f2654eab9c0e");//应用APPKEY(应用详细页查询)
|
|
params.put("key", "fbe7b165e9e13e52f3b1f2654eab9c0e");//应用APPKEY(应用详细页查询)
|
|
|
params.put("dtype", "json");//返回数据的格式,xml或json,默认json
|
|
params.put("dtype", "json");//返回数据的格式,xml或json,默认json
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- result = net(urlNet, params, "GET");
|
|
|
|
|
|
|
+ result = net(urlNet, params, "POST");
|
|
|
JSONObject object = JSONObject.parseObject(result);
|
|
JSONObject object = JSONObject.parseObject(result);
|
|
|
if (object.getInteger("error_code") == 0) {
|
|
if (object.getInteger("error_code") == 0) {
|
|
|
// System.out.println(object.get("result"));
|
|
// System.out.println(object.get("result"));
|