Ver código fonte

直播间授权直播观看地址调整更新

沈静伟 4 anos atrás
pai
commit
8131981ade

+ 13 - 6
src/dsb/com/cnd3b/restcontroller/enterprise/live/live.java

@@ -178,9 +178,12 @@ public class live extends Controller {
             return getErrReturnObject().toString();
         } else {
             String fliveshowurl = "https://www.buwanjia.com/customer/index.html#/authLiveLogin?tliveid=" + tliveid;
-            dbConnect.runSqlUpdate("update tlive set fliveshowurl='" + fliveshowurl + "', fisneedauth=1,secretkey='" + secretKey + "' where siteid='" + siteid + "' and tliveid='" + tliveid + "'");
-            //需将改为新的直播观看地址
-            return queryChannelMain();
+            String status = dbConnect.runSqlUpdate("update tlive set fliveshowurl='" + fliveshowurl + "', fisneedauth=1,secretkey='" + secretKey + "' where siteid='" + siteid + "' and tliveid='" + tliveid + "'");
+            if (status.equals("true")) {
+                return queryChannelMain();
+            } else {
+                return getErrReturnObject().setErrMsg(status).toString();
+            }
         }
     }
 
@@ -198,9 +201,13 @@ public class live extends Controller {
         String channelid = rows.get(0).getString("channelid");
         Polyv polyv = new Polyv();
         if (polyv.closeChannelAuthExternal(channelid)) {
-            dbConnect.runSqlUpdate("update tlive set fisneedauth=0,secretkey=null where siteid='" + siteid + "' and tliveid='" + tliveid + "'");
-            //需将改为新的直播观看地址
-            return queryChannelMain();
+            String fliveshowurl = "https://live.polyv.cn/watch/" + channelid;
+            String status = dbConnect.runSqlUpdate("update tlive set fliveshowurl='" + fliveshowurl + "', fisneedauth=0,secretkey=null where siteid='" + siteid + "' and tliveid='" + tliveid + "'");
+            if (status.equals("true")) {
+                return queryChannelMain();
+            } else {
+                return getErrReturnObject().setErrMsg(status).toString();
+            }
         } else {
             return getErrReturnObject().toString();
         }