更换 接口域名

This commit is contained in:
liuyalei 2024-03-06 15:04:14 +08:00
parent 2140d2b26f
commit 97a86609ff
2 changed files with 5 additions and 3 deletions

View File

@ -300,10 +300,10 @@ const sendMessage = () => {
let messageValue = inputText.value.trim() let messageValue = inputText.value.trim()
if (inputText.value.trim()) { if (inputText.value.trim()) {
messages.push({ id: Date.now(), text: inputText.value, isMe: true, type: 'txt' }); 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); console.log("res", res);
// var msg = JSON.parse(res.name) // 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' }); messages.push({ id: Date.now() + 1, text: msg, isMe: false, type: 'txt' });
scollToButtom() scollToButtom()
}).catch(error => { }).catch(error => {

View File

@ -11,8 +11,10 @@ export default defineConfig({
hmr: true, // 自动热更新 hmr: true, // 自动热更新
proxy: { proxy: {
"/test": { "/test": {
target: "http://192.168.2.86:8003", // target: "http://192.168.2.86:8003",
target: "http://aiai.cityme.com.cn/generate",
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/\/test/, ""), //重写真实路径,替换/api
}, },
'/srv': { '/srv': {
target: 'http://36.140.118.172:88',//沈涛 target: 'http://36.140.118.172:88',//沈涛