diff --git a/src/views/IndexChat.vue b/src/views/IndexChat.vue index 89ce27f..5d63b45 100644 --- a/src/views/IndexChat.vue +++ b/src/views/IndexChat.vue @@ -300,7 +300,7 @@ 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', { "text": messageValue }).then((res) => { + http.post('/generate', { "text": messageValue }).then((res) => { console.log("res", res); // var msg = JSON.parse(res.name) var msg = res.response diff --git a/vite.config.js b/vite.config.js index dded420..98a119e 100644 --- a/vite.config.js +++ b/vite.config.js @@ -10,11 +10,11 @@ export default defineConfig({ host: "0.0.0.0", // ← 新增内容 ← hmr: true, // 自动热更新 proxy: { - "/test": { + "/generate": { // target: "http://192.168.2.86:8003", - target: "http://aiai.cityme.com.cn/generate", + target: "https://aiai.cityme.com.cn", changeOrigin: true, - rewrite: (path) => path.replace(/\/test/, ""), //重写真实路径,替换/api + // rewrite: (path) => path.replace(/\/test/, ""), //重写真实路径,替换/api }, '/srv': { target: 'http://36.140.118.172:88',//沈涛