提交 54d8631c authored 作者: 000516's avatar 000516 提交者: Coding

重置AppID(小程序ID)、AppSecret

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