xgb 6 дней назад
Родитель
Сommit
8298622f90

+ 5 - 11
fs-service/src/main/java/com/fs/course/service/impl/FsCourseLinkServiceImpl.java

@@ -794,16 +794,10 @@ public class FsCourseLinkServiceImpl implements IFsCourseLinkService
                 final WxMaService wxService = WxMaConfiguration.getMaService(appId);
                 String token = wxService.getAccessToken();
                 log.info("小程序TOKEN值-------->刷新前TOKEN:{}", token);
-                HttpPost httpPost = new HttpPost("https://api.weixin.qq.com/wxa/generatescheme?access_token=" + token);
+                HttpPost httpPost = new HttpPost("https://api.weixin.qq.com/wxa/generate_urllink?access_token=" + token);
                 JSONObject bodyObj = new JSONObject();
-                JSONObject jumpWxa = new JSONObject();
-                jumpWxa.put("path", pageUrl);
-                jumpWxa.put("query", query);
-                jumpWxa.put("env_version", "release");
-                bodyObj.put("jump_wxa", jumpWxa);
-                bodyObj.put("is_expire", false);
-                bodyObj.put("expire_type", 1);
-                bodyObj.put("expire_interval", 30);
+                bodyObj.put("path", pageUrl);
+                bodyObj.put("query", query);
                 log.info("微信小程序请求参数打印:{}", bodyObj.toJSONString());
                 StringEntity entity = new StringEntity(bodyObj.toJSONString(),"UTF-8");
                 httpPost.setEntity(entity);
@@ -827,8 +821,8 @@ public class FsCourseLinkServiceImpl implements IFsCourseLinkService
                     }
                 }
 
-                if(null != jsonObject && !jsonObject.isEmpty() && jsonObject.containsKey("openlink")){
-                    return jsonObject.getString("openlink");
+                if(null != jsonObject && !jsonObject.isEmpty() && jsonObject.containsKey("url_link")){
+                    return jsonObject.getString("url_link");
                 }
 
                 // 处理微信错误响应