diff --git a/taoyao-client-web/src/components/Taoyao.js b/taoyao-client-web/src/components/Taoyao.js index 9e629a1..8d01aff 100644 --- a/taoyao-client-web/src/components/Taoyao.js +++ b/taoyao-client-web/src/components/Taoyao.js @@ -137,16 +137,13 @@ const signalChannel = { */ async connect(address, reconnection = true) { const me = this; - // 直接返回旧的连接 if (me.connected()) { + this.taoyao.connect = true; return new Promise((resolve, reject) => { resolve(me.channel); }); - } - // 关闭旧的无效连接 - if(this.channel) { - console.debug("关闭旧的信令连接", this.address); - this.close(); + } else { + this.taoyao.connect = false; } me.address = address; me.reconnection = reconnection;