提交 8c558bf5 authored 作者: 李秋林's avatar 李秋林

重置AppID(小程序ID)、AppSecret

上级 36894d6b
......@@ -27,8 +27,7 @@ public class MiappInfoController {
*/
@GetMapping("/wxtoken")
public R getCX() {
Map<String, String> cxInfo = tencentUtils.getCX();
return R.success(tencentUtils.getMiniappToken(cxInfo));
return R.success(tencentUtils.getMiniappToken());
}
@GetMapping("/phone")
......@@ -38,7 +37,6 @@ public class MiappInfoController {
@GetMapping("/openid")
public R getOpenid(String jsCode){
Map<String, String> cxInfo = tencentUtils.getCX();
return R.success(tencentUtils.getOpenid(jsCode,cxInfo));
return R.success(tencentUtils.getOpenid(jsCode));
}
}
......@@ -142,11 +142,11 @@ public class TencentUtils {
}
}
public JSONObject getMiniappToken(Map<String, String> miniappInfo) {
String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+miniappInfo.get("appId")+"&secret="+miniappInfo.get("appSecret");
public JSONObject getMiniappToken() {
String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+xltAppId+"&secret="+xltAppSecret;
String body = HttpUtil.createGet(url).execute().body();
JSONObject jsonObject = JSONObject.parseObject(body);
jsonObject.putAll(miniappInfo);
jsonObject.put("appId", xltAppId);
return jsonObject;
}
......@@ -158,8 +158,8 @@ public class TencentUtils {
return JSONObject.parseObject(body);
}
public JSONObject getOpenid(String jsCode,Map<String, String> miniappInfo) {
String url = "https://api.weixin.qq.com/sns/jscode2session?appid="+miniappInfo.get("appId")+"&secret="+miniappInfo.get("appSecret")+"&js_code="+jsCode+"&grant_type=authorization_code";
public JSONObject getOpenid(String jsCode) {
String url = "https://api.weixin.qq.com/sns/jscode2session?appid="+xltAppId+"&secret="+xltAppSecret+"&js_code="+jsCode+"&grant_type=authorization_code";
String body = HttpUtil.createGet(url).execute().body();
return JSONObject.parseObject(body);
}
......
......@@ -36,7 +36,7 @@ wx:
miniapp:
configs:
- appid: wxac14dc7765484d7d
secret: b3315e66608a397f88e7e82b8f950bcd
secret: e73b574380a822c942e03ea4dc67aaa1
token: #微信小程序消息服务器配置的token
aesKey: #微信小程序消息服务器配置的EncodingAESKey
msgDataFormat: JSON
......@@ -46,7 +46,7 @@ wx:
token_secret: xZq%kXASSPD$UtL
cx_miniapp:
app_id: wxac14dc7765484d7d
app_secret: b3315e66608a397f88e7e82b8f950bcd
app_secret: e73b574380a822c942e03ea4dc67aaa1
tengxunyun:
# 腾讯云个人账号信息
......
......@@ -35,7 +35,7 @@ wx:
miniapp:
configs:
- appid: wxac14dc7765484d7d
secret: b3315e66608a397f88e7e82b8f950bcd
secret: e73b574380a822c942e03ea4dc67aaa1
token: #微信小程序消息服务器配置的token
aesKey: #微信小程序消息服务器配置的EncodingAESKey
msgDataFormat: JSON
......@@ -45,7 +45,7 @@ wx:
token_secret: xZq%kXASSPD$UtL
cx_miniapp:
app_id: wxac14dc7765484d7d
app_secret: b3315e66608a397f88e7e82b8f950bcd
app_secret: e73b574380a822c942e03ea4dc67aaa1
tengxunyun:
# 腾讯云个人账号信息
secret_d: AKIDVt353sWyY0GXn0ANa0YyGdwDIBtjQwGS
......
......@@ -36,7 +36,7 @@ wx:
miniapp:
configs:
- appid: wxac14dc7765484d7d
secret: b3315e66608a397f88e7e82b8f950bcd
secret: e73b574380a822c942e03ea4dc67aaa1
token: #微信小程序消息服务器配置的token
aesKey: #微信小程序消息服务器配置的EncodingAESKey
msgDataFormat: JSON
......@@ -46,7 +46,7 @@ wx:
token_secret: xZq%kXASSPD$UtL
cx_miniapp:
app_id: wxac14dc7765484d7d
app_secret: b3315e66608a397f88e7e82b8f950bcd
app_secret: e73b574380a822c942e03ea4dc67aaa1
tengxunyun:
# 腾讯云个人账号信息
secret_d: AKIDVt353sWyY0GXn0ANa0YyGdwDIBtjQwGS
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论