mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 03:55:17 +08:00
新增 微信第三方平台 发布已通过审核的小程序接口
This commit is contained in:
@@ -465,6 +465,28 @@ public class AgentDevService {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布已通过审核的小程序 调用本接口可以发布最后一个审核通过的小程序代码版本
|
||||
* https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/code-management/release.html
|
||||
* @return
|
||||
*/
|
||||
public String releaseProcedure(String authorizerAppid){
|
||||
// 获取用户接口调用令牌
|
||||
String redisKey = CacheConstants.AUTHORIZER_ACCESS_TOKEN + authorizerAppid;
|
||||
String authAccessToken = redisCache.getCacheObject(redisKey);
|
||||
if (StringUtils.isBlank(authAccessToken)) {
|
||||
throw new RuntimeException("微信第三方平台 发布已通过审核的小程序 error: authAccessToken为空");
|
||||
}
|
||||
String url = "https://api.weixin.qq.com/wxa/release?access_token=" + authAccessToken;
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
// 将返回结果转为json对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
// int errCode = (int) resultJson.get("errcode");
|
||||
|
||||
return resultJson.getString("errmsg");
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
JSONArray array = new JSONArray();
|
||||
|
||||
Reference in New Issue
Block a user