From 21677f914b39d5c4ad419ad60ed2c95e24ab7d98 Mon Sep 17 00:00:00 2001 From: unknown <1162963624@qq.com> Date: Mon, 30 Nov 2020 15:45:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=97=AD=E7=9B=B4=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/common.js | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/public/js/common.js b/public/js/common.js index 8ea80ef..b4c196a 100644 --- a/public/js/common.js +++ b/public/js/common.js @@ -169,14 +169,31 @@ function setBtnClickFuc() { }).catch(function(imError) { console.warn('dismissGroup error:', imError); // 解散群组失败的相关信息 }); - $.ajax({ - url: window.url + 'StopMCUMixTranscode?roomid=' + window.roomid, - headers: "Bearer " + localStorage.getItem("token"), - success(){ - window.parent.location.href="/regime/livedetail?id=" + window.liveid; - } + const jiekou = new Promise((res)=>{ + $.ajax({ + url: window.url + 'StopMCUMixTranscode?roomid=' + window.roomid, + headers: "Bearer " + localStorage.getItem("token"), + success(){ + res(1) + } + }) + }) + const jieshu = new Promise((res)=>{ + $.ajax({ + url: window.url + 'live?liveid=' + window.liveid, + headers: "Bearer " + localStorage.getItem("token"), + method:"POST", + data:{ + status: 2 + }, + success(){ + res(1) + } + }) + }) + Promise.allSettled([promise,jiekou,jieshu]).then(()=>{ + window.parent.location.href="/regime/livedetail?id=" + window.liveid; }) - } else{