|  |  |  | 
|---|
|  |  |  | this.timeout = this.$route.query.timeout; | 
|---|
|  |  |  | // 防止用户多次连续点击发起请求,所以要先关闭上次的ws请求。 | 
|---|
|  |  |  | closeWebsocket(); | 
|---|
|  |  |  | console.log(this.id); | 
|---|
|  |  |  | const obj = { | 
|---|
|  |  |  | type: "text", | 
|---|
|  |  |  | userId: this.userid, | 
|---|
|  |  |  | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | // 发起ws请求 | 
|---|
|  |  |  | sendWebsocket( | 
|---|
|  |  |  | "ws://192.168.2.13:8095/chat?userId="+this.userid, | 
|---|
|  |  |  | "ws://9.208.2.190:8095/chat?userId="+this.userid, | 
|---|
|  |  |  | obj, | 
|---|
|  |  |  | this.wsMessage, | 
|---|
|  |  |  | this.wsError | 
|---|
|  |  |  | 
|---|
|  |  |  | //     isEat: 1, | 
|---|
|  |  |  | //   }); | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | timerId = setTimeout(() => { | 
|---|
|  |  |  | if (!this.answer) { | 
|---|
|  |  |  | this.sendFn(); // 后调用 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, this.timeout * 1000); | 
|---|
|  |  |  | if (condition) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // clearTimeout(timerId) | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 优先加入通用库匹配文本 | 
|---|
|  |  |  | if (dataJson.nowQuestion.submoduleText) { | 
|---|
|  |  |  | this.Answerline.push({ | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | return item; | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | if (!dataJson.jsy) { | 
|---|
|  |  |  | timerId = setTimeout(() => { | 
|---|
|  |  |  | if (!this.answer) { | 
|---|
|  |  |  | this.sendFn(); // 后调用 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, this.timeout * 1000); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | clearTimeout(timerId) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | console.log(this.questionList); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // IMUI.appendMessage(data); | 
|---|
|  |  |  | 
|---|
|  |  |  | console.log(obj, "入参"); | 
|---|
|  |  |  | // 发起ws请求 | 
|---|
|  |  |  | sendWebsocket( | 
|---|
|  |  |  | "ws://192.168.2.13:8095/chat?userId="+this.userid, | 
|---|
|  |  |  | "ws://9.208.2.190:8095/chat?userId="+this.userid, | 
|---|
|  |  |  | obj, | 
|---|
|  |  |  | this.wsMessage, | 
|---|
|  |  |  | this.wsError | 
|---|