From a241be080df0ca1d430e3f9d03d5c268d14b3164 Mon Sep 17 00:00:00 2001 From: liuyalei Date: Mon, 19 Feb 2024 16:32:31 +0800 Subject: [PATCH 1/4] add --- src/views/IndexChat.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/IndexChat.vue b/src/views/IndexChat.vue index c987c88..b72cdb6 100644 --- a/src/views/IndexChat.vue +++ b/src/views/IndexChat.vue @@ -304,6 +304,7 @@ const sendMessage = () => { console.log("res", res); var msg = JSON.parse(res.name) messages.push({ id: Date.now() + 1, text: msg, isMe: false, type: 'txt' }); + scollToButtom() }).catch(error => { console.log(error) }) @@ -771,7 +772,7 @@ onMounted(() => { align-items: center; justify-content: center; flex-direction: column; - + cursor: default; .heng { width: 21px; height: 1px; From 2140d2b26f640d359470418f3f7f4d03bd5fc1ae Mon Sep 17 00:00:00 2001 From: liuyalei Date: Tue, 20 Feb 2024 17:30:42 +0800 Subject: [PATCH 2/4] gx --- index.html | 2 -- src/views/IndexChat.vue | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index d6129ff..12e8942 100644 --- a/index.html +++ b/index.html @@ -11,8 +11,6 @@ diff --git a/src/views/IndexChat.vue b/src/views/IndexChat.vue index b72cdb6..95ae672 100644 --- a/src/views/IndexChat.vue +++ b/src/views/IndexChat.vue @@ -254,7 +254,7 @@
- +
@@ -302,7 +302,8 @@ const sendMessage = () => { messages.push({ id: Date.now(), text: inputText.value, isMe: true, type: 'txt' }); http.post('/test/main_serve/', { "text": messageValue }).then((res) => { console.log("res", res); - var msg = JSON.parse(res.name) + // var msg = JSON.parse(res.name) + var msg = res.name messages.push({ id: Date.now() + 1, text: msg, isMe: false, type: 'txt' }); scollToButtom() }).catch(error => { From 97a86609ffb2fce13c1e10222e41f41ba0c68847 Mon Sep 17 00:00:00 2001 From: liuyalei Date: Wed, 6 Mar 2024 15:04:14 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=20=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/IndexChat.vue | 4 ++-- vite.config.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/views/IndexChat.vue b/src/views/IndexChat.vue index 95ae672..c06a426 100644 --- a/src/views/IndexChat.vue +++ b/src/views/IndexChat.vue @@ -300,10 +300,10 @@ const sendMessage = () => { let messageValue = inputText.value.trim() if (inputText.value.trim()) { messages.push({ id: Date.now(), text: inputText.value, isMe: true, type: 'txt' }); - http.post('/test/main_serve/', { "text": messageValue }).then((res) => { + http.post('/test', { "text": messageValue }).then((res) => { console.log("res", res); // var msg = JSON.parse(res.name) - var msg = res.name + var msg = res.response messages.push({ id: Date.now() + 1, text: msg, isMe: false, type: 'txt' }); scollToButtom() }).catch(error => { diff --git a/vite.config.js b/vite.config.js index c468db1..dded420 100644 --- a/vite.config.js +++ b/vite.config.js @@ -11,8 +11,10 @@ export default defineConfig({ hmr: true, // 自动热更新 proxy: { "/test": { - target: "http://192.168.2.86:8003", + // target: "http://192.168.2.86:8003", + target: "http://aiai.cityme.com.cn/generate", changeOrigin: true, + rewrite: (path) => path.replace(/\/test/, ""), //重写真实路径,替换/api }, '/srv': { target: 'http://36.140.118.172:88',//沈涛 From 668b7a835f93905f685fd42a69d0da4436a88c2a Mon Sep 17 00:00:00 2001 From: liuyalei Date: Wed, 6 Mar 2024 15:20:02 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9A=82=E6=97=B6=20=E5=BF=BD=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/IndexChat.vue | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/views/IndexChat.vue b/src/views/IndexChat.vue index c06a426..89ce27f 100644 --- a/src/views/IndexChat.vue +++ b/src/views/IndexChat.vue @@ -309,26 +309,26 @@ const sendMessage = () => { }).catch(error => { console.log(error) }) - if (inputText.value.indexOf('导航') != -1 || inputText.value.indexOf('怎么走') != -1) { - messagesCopy[10].id = Date.now(); - messages.push(messagesCopy[10]); - } else if (inputText.value.indexOf('医生') != -1) { - messagesCopy[4].id = Date.now(); - messagesCopy[5].id = Date.now() + 1; - messages.push(messagesCopy[4], messagesCopy[5]); - } else if (inputText.value.indexOf('总是头疼') != -1) { - messagesCopy[7].id = Date.now(); - messages.push(messagesCopy[7]); - } else if (inputText.value.indexOf('普通') != -1 || inputText.value.indexOf('专家') != -1) { - messagesCopy[8].id = Date.now(); - messages.push(messagesCopy[8]); - } else if (inputText.value.indexOf('医院') != -1) { - messagesCopy[2].id = Date.now(); - messagesCopy[3].id = Date.now() + 1; - messages.push(messagesCopy[2], messagesCopy[3]); - } else { - // messages.push({ id: Date.now(), text: '抱歉没听懂 您可以尝试输入 最近总是头疼挂什么科室', isMe: false, type: 'txt' }); - } + // if (inputText.value.indexOf('导航') != -1 || inputText.value.indexOf('怎么走') != -1) { + // messagesCopy[10].id = Date.now(); + // messages.push(messagesCopy[10]); + // } else if (inputText.value.indexOf('医生') != -1) { + // messagesCopy[4].id = Date.now(); + // messagesCopy[5].id = Date.now() + 1; + // messages.push(messagesCopy[4], messagesCopy[5]); + // } else if (inputText.value.indexOf('总是头疼') != -1) { + // messagesCopy[7].id = Date.now(); + // messages.push(messagesCopy[7]); + // } else if (inputText.value.indexOf('普通') != -1 || inputText.value.indexOf('专家') != -1) { + // messagesCopy[8].id = Date.now(); + // messages.push(messagesCopy[8]); + // } else if (inputText.value.indexOf('医院') != -1) { + // messagesCopy[2].id = Date.now(); + // messagesCopy[3].id = Date.now() + 1; + // messages.push(messagesCopy[2], messagesCopy[3]); + // } else { + // messages.push({ id: Date.now(), text: '抱歉没听懂 您可以尝试输入 最近总是头疼挂什么科室', isMe: false, type: 'txt' }); + // } // console.log("messages", messages) scollToButtom(); inputText.value = '';