Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ ZEP_API_KEY=your_zep_api_key_here
# 注意如果不使用加速配置,env文件中就不要出现下面的配置项
LLM_BOOST_API_KEY=your_api_key_here
LLM_BOOST_BASE_URL=your_base_url_here
LLM_BOOST_MODEL_NAME=your_model_name_here
LLM_BOOST_MODEL_NAME=your_model_name_here

# ===== 前端 / 部署配置(可选)=====
# 后端 API 地址(axios 客户端 + Vite 开发代理均读取此变量)
# 默认值:http://localhost:5001
# 若后端运行在其他主机或端口,请取消注释并修改为对应地址
# VITE_API_BASE_URL=http://localhost:5001
39 changes: 22 additions & 17 deletions frontend/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
import { defineConfig } from 'vite'
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
'@locales': path.resolve(__dirname, '../locales')
}
},
server: {
port: 3000,
open: true,
proxy: {
'/api': {
target: 'http://localhost:5001',
changeOrigin: true,
secure: false
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, path.resolve(__dirname, '..'), '')
const backendUrl = env.VITE_API_BASE_URL || 'http://localhost:5001'

return {
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
'@locales': path.resolve(__dirname, '../locales')
}
},
server: {
port: 3000,
open: true,
proxy: {
'/api': {
target: backendUrl,
changeOrigin: true,
secure: false
}
}
}
}
Expand Down