fix(config): 更新AI代理配置为本地Ollama服务

- 将AI代理目标从远程服务器改为本地127.0.1:11434
- 更新Nginx配置中的代理地址和Host头部设置
- 修改AI_API_URL默认值指向本地Ollama服务
- 调整AI视图组件中的基础URL配置逻辑
- 更新环境变量示例文件中的默认API地址
- 修正Vite开发服务器代理配置指向本地服务
This commit is contained in:
2026-02-28 01:42:18 +08:00
parent 91708315f3
commit ac9712819a
5 changed files with 14 additions and 12 deletions

View File

@@ -101,7 +101,7 @@ export default defineConfig(({ command, mode }) => {
// GET /ai-proxy/models -> https://ai.websoft.top/api/v1/models
// POST /ai-proxy/chat/completions -> https://ai.websoft.top/api/v1/chat/completions
'/ai-proxy': {
target: env.AI_PROXY_TARGET || 'https://ai-api.websoft.top',
target: env.AI_PROXY_TARGET || 'http://127.0.0.1:11434',
changeOrigin: true,
secure: false,
rewrite: (path) =>
@@ -124,10 +124,10 @@ export default defineConfig(({ command, mode }) => {
}
},
// Ollama native API reverse proxy (dev only).
// GET /proxy/api/tags -> http://47.119.165.234:11434/api/tags
// POST /proxy/api/chat -> http://47.119.165.234:11434/api/chat
// GET /proxy/api/tags -> http://127.0.0.1:11434/api/tags
// POST /proxy/api/chat -> http://127.0.0.1:11434/api/chat
'/proxy': {
target: 'http://47.119.165.234:11434',
target: 'http://127.0.0.1:11434',
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(/^\/proxy/, '')