Your Name 3 years ago
parent
commit
c38d40d3d2

+ 9
- 2
src/main/java/com/yunzhi/marketing/common/WorkWxUtils.java View File

@@ -47,7 +47,14 @@ public class WorkWxUtils {
47 47
             params.put("limit", 10);
48 48
             JSONObject result = post("/cgi-bin/living/get_user_all_livingid", params);
49 49
             JSONArray lst = result.getJSONArray("livingid_list");
50
-            return lst.size() > 0 ? (String) lst.get(0) : null;
50
+            String livingId = lst.size() > 0 ? (String) lst.get(0) : null;
51
+
52
+//            if (!StringUtils.isEmpty(livingId)) {
53
+//                JSONObject res = post("/cgi-bin/living/get_living_info?livingid="+StringUtils.urlEncode(livingId), null);
54
+//                System.out.println(res);
55
+//            }
56
+
57
+            return livingId;
51 58
         } catch (WxErrorException e) {
52 59
             if (90601 == e.getError().getErrorCode()) {
53 60
                 throw new Exception("直播房间不存在");
@@ -92,7 +99,7 @@ public class WorkWxUtils {
92 99
 
93 100
     private JSONObject post(String url, JSONObject data) throws WxErrorException {
94 101
         String uri = wxCpService.getWxCpConfigStorage().getApiUrl(url);
95
-        String response = wxCpService.post(uri, data.toJSONString());
102
+        String response = wxCpService.post(uri, null != data  ? data.toJSONString() : null);
96 103
         return JSONObject.parseObject(response);
97 104
     }
98 105
 }

+ 2
- 2
src/main/java/com/yunzhi/marketing/controller/TaLiveActivityController.java View File

@@ -306,11 +306,11 @@ public class TaLiveActivityController extends BaseController {
306 306
     }
307 307
 
308 308
     @GetMapping("/wx/taLiveActivity/work/livingCode")
309
-    public ResponseBean getWorkLivingCode(@RequestParam String livingid,
309
+    public ResponseBean getWorkLivingCode(@RequestParam("user") String user,
310 310
                                           HttpServletRequest request) {
311 311
         String openid = getOpenId(request);
312 312
         try {
313
-            String id = workWxUtils.getLivingId(livingid);
313
+            String id = workWxUtils.getLivingId(user);
314 314
             String livingCode = workWxUtils.getLivingCode(id, openid);
315 315
             return ResponseBean.success(livingCode);
316 316
         } catch (Exception e) {