|
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
|
import com.google.gson.reflect.TypeToken;
|
|
import com.google.gson.reflect.TypeToken;
|
|
|
import com.happy.Model.Message.Mp_template_msg;
|
|
import com.happy.Model.Message.Mp_template_msg;
|
|
|
|
|
+import com.happy.Model.weixin.WeiXinUtil;
|
|
|
|
|
+
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -22,8 +24,8 @@ public class Message2 {
|
|
|
throws Exception {
|
|
throws Exception {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("grant_type", "client_credential");
|
|
jsonObject.put("grant_type", "client_credential");
|
|
|
- jsonObject.put("appid", "wx2fc3f45732fae5d3"); // 小程序
|
|
|
|
|
- jsonObject.put("secret","7eee4a49a4470a77f9222995e8511547");
|
|
|
|
|
|
|
+ jsonObject.put("appid", WeiXinUtil.appid_c); // 小程序
|
|
|
|
|
+ jsonObject.put("secret",WeiXinUtil.screct_c);
|
|
|
String msg3 = HttpsClient.sendJson2("https://api.weixin.qq.com/cgi-bin/stable_token",jsonObject);
|
|
String msg3 = HttpsClient.sendJson2("https://api.weixin.qq.com/cgi-bin/stable_token",jsonObject);
|
|
|
Gson gson = new Gson();
|
|
Gson gson = new Gson();
|
|
|
HashMap<String, String> userMap = gson.fromJson(msg3.toString(), new TypeToken<HashMap<String, String>>() {}.getType());
|
|
HashMap<String, String> userMap = gson.fromJson(msg3.toString(), new TypeToken<HashMap<String, String>>() {}.getType());
|
|
@@ -32,11 +34,11 @@ public class Message2 {
|
|
|
message.put("touser", openid);
|
|
message.put("touser", openid);
|
|
|
|
|
|
|
|
Mp_template_msg mp_template_msg = new Mp_template_msg();
|
|
Mp_template_msg mp_template_msg = new Mp_template_msg();
|
|
|
- mp_template_msg.setAppid("wxa46ef222053a1047"); // 公众号
|
|
|
|
|
- mp_template_msg.setTemplate_id("2qQLkDrxBpMcao35jONQSo8GIY6wwzFna-LLU7Q7qRM");
|
|
|
|
|
|
|
+ mp_template_msg.setAppid(WeiXinUtil.appid_g); // 公众号
|
|
|
|
|
+ mp_template_msg.setTemplate_id("pQLY-9pKW-lD-6PuOlxieatGmuCHOezubTxI99cs7Zo");
|
|
|
mp_template_msg.setUrl("index");
|
|
mp_template_msg.setUrl("index");
|
|
|
JSONObject jsonObject1 = new JSONObject();
|
|
JSONObject jsonObject1 = new JSONObject();
|
|
|
- jsonObject1.put("appid","wx2fc3f45732fae5d3");
|
|
|
|
|
|
|
+ jsonObject1.put("appid",WeiXinUtil.appid_c);
|
|
|
jsonObject1.put("pagepath","/pages/orderDetail/orderDetail?id="+id);
|
|
jsonObject1.put("pagepath","/pages/orderDetail/orderDetail?id="+id);
|
|
|
mp_template_msg.setMiniprogram(jsonObject1);
|
|
mp_template_msg.setMiniprogram(jsonObject1);
|
|
|
// 订单号
|
|
// 订单号
|