From 5e6f1b608dbd2f256297ebebaccbebf5f07c44f6 Mon Sep 17 00:00:00 2001 From: acgist <289547414@qq.com> Date: Fri, 20 Oct 2023 07:35:27 +0800 Subject: [PATCH] =?UTF-8?q?[*]=20=E6=97=A5=E5=B8=B8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- taoyao-client-web/src/App.vue | 2 +- taoyao-client-web/src/components/Taoyao.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/taoyao-client-web/src/App.vue b/taoyao-client-web/src/App.vue index 293522a..dca2c48 100644 --- a/taoyao-client-web/src/App.vue +++ b/taoyao-client-web/src/App.vue @@ -164,7 +164,7 @@ export default { }, async loadList() { this.rooms = await this.taoyao.roomList(); - this.medias = await this.taoyao.mediaList(); + this.medias = await this.taoyao.mediaServerList(); this.clients = await this.taoyao.mediaClientList(); }, async sessionCall() { diff --git a/taoyao-client-web/src/components/Taoyao.js b/taoyao-client-web/src/components/Taoyao.js index 798fdd3..f129095 100644 --- a/taoyao-client-web/src/components/Taoyao.js +++ b/taoyao-client-web/src/components/Taoyao.js @@ -1230,11 +1230,14 @@ class Taoyao extends RemoteClient { /** * @returns 媒体服务列表 */ - async mediaList() { + async mediaServerList() { const response = await this.request(protocol.buildMessage("client::list", { clientType: "MEDIA" })); - return response.body; + const { + body + } = response; + return body || []; } /** @@ -1242,7 +1245,10 @@ class Taoyao extends RemoteClient { */ async mediaClientList() { const response = await this.request(protocol.buildMessage("client::list", {})); - return response.body.filter(v => { + const { + body + } = response; + return (body || []).filter(v => { return v.clientType === "WEB" || v.clientType === "CAMERA" || v.clientType === "MOBILE"; }); }