提交
This commit is contained in:
@@ -187,6 +187,7 @@ export default {
|
||||
fileList1: [],
|
||||
|
||||
containerHeight: null,
|
||||
pollInterval: null,
|
||||
formData: {
|
||||
message: "",
|
||||
},
|
||||
@@ -776,11 +777,12 @@ export default {
|
||||
const poll = () => {
|
||||
this.getMedicalDetail(() => {
|
||||
// 停止轮询
|
||||
clearInterval(pollInterval);
|
||||
clearInterval(this.pollInterval);
|
||||
this.pollInterval = null;
|
||||
});
|
||||
};
|
||||
// 每5秒发送一次请求,直到收到正确的响应
|
||||
const pollInterval = setInterval(poll, 5000);
|
||||
this. pollInterval = setInterval(poll, 5000);
|
||||
|
||||
//调用后端 SSE 接口,发送问题并接收实时回答
|
||||
// this.startSSE(params);
|
||||
@@ -1183,9 +1185,11 @@ export default {
|
||||
},
|
||||
},
|
||||
onHide() {
|
||||
|
||||
this.closeWebSocket();
|
||||
},
|
||||
onUnload() {
|
||||
this.pollInterval()
|
||||
this.closeWebSocket();
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user