api配置更改

This commit is contained in:
fsy
2025-03-18 20:02:21 +08:00
parent 1dfedce690
commit 53493be75d
3 changed files with 48 additions and 20 deletions

View File

@@ -5,4 +5,32 @@ import path from 'path'
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
host: '0.0.0.0',
port: 3000,
open: true,
cors:true,
proxy:{
'/create-api':{
// target:'https://api.agora.io/cn/api/conversational-ai-agent/v2',
target: 'https://api.sd-rtn.com/cn/api/conversational-ai-agent/v2',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/create-api/, ''),
headers: {
'Authorization': 'Basic OGRkM2EzOGUxNTJjNGU1NDlmNWMwOTg0YmRhYzc1ZTE6ZWY1MTI2ZTRmMWFlNGE5MWE0MzVhN2Q0ZDc0YzNlYjg=',
}
},
'/llm-api':{
target:'https://vip.apiyi.com/v1/chat/completions',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/llm-api/, ''),
}
}
}
})