| | |
| | | created() { |
| | | this.TemplateName = this.$route.query.name; |
| | | this.userid = store.getters.Id; |
| | | console.log(store.getters.Id,'11'); |
| | | |
| | | this.requstWs(); //进入页面创建连接 |
| | | }, |
| | | mounted() { |
| | |
| | | }; |
| | | // 发起ws请求 |
| | | sendWebsocket( |
| | | "ws://192.168.2.10:8095/chat?userId="+this.userId, |
| | | "ws://192.168.2.10:8095/chat?userId="+this.userid, |
| | | obj, |
| | | this.wsMessage, |
| | | this.wsError |
| | |
| | | // isEat: 1, |
| | | // }); |
| | | // } |
| | | timerId = setTimeout(() => { |
| | | if (!this.answer) { |
| | | this.sendFn(); // 后调用 |
| | | } |
| | | }, this.timeout * 1000); |
| | | |
| | | |
| | | |
| | | // 优先加入通用库匹配文本 |
| | | 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); |
| | |
| | | // 消息发送 |
| | | const obj = { |
| | | type: "text", |
| | | userId: this.userId, |
| | | userId: this.userid, |
| | | templateId: "", |
| | | questionMessage: { content: this.answer }, |
| | | }; |
| | | console.log(obj, "入参"); |
| | | // 发起ws请求 |
| | | sendWebsocket( |
| | | "ws://192.168.2.10:8095/chat?userId="+this.userId, |
| | | "ws://192.168.2.10:8095/chat?userId="+this.userid, |
| | | obj, |
| | | this.wsMessage, |
| | | this.wsError |
| | |
| | | overflow: auto; |
| | | .leftside { |
| | | margin-bottom: 30px; |
| | | width: 600px; |
| | | max-width: 566px; |
| | | margin-left: 20px; |
| | | padding: 10px; |
| | | color: #fff; |