diff --git a/src/views/App.vue b/src/views/App.vue index 3c4492d2654f735efc94376aefe01634e57d045f..9a9d66eacf5829c7d1421330a269c8039f1ff7a2 100644 --- a/src/views/App.vue +++ b/src/views/App.vue @@ -107,13 +107,6 @@ export default { onmessage: (msg) => { if (msg.data === '[DONE]') { this.loading = false; - axios({ - method: "post", - url: "https://flask-wujiaping.inscode.cc/addhistory", - data: dialog.text, - }).then((res) => { - console.log(res.data) - }); return; }; const data = JSON.parse(msg.data); @@ -128,6 +121,15 @@ export default { dialog.text += text; } }, + onclose() { + axios({ + method: "post", + url: "https://flask-wujiaping.inscode.cc/addhistory", + data: dialog.text, + }).then((res) => { + console.log(res.data) + }); + }, onerror: (err) => { console.log("error", err); }