This commit is contained in:
macbook_max
2026-10-15 20:36:59 +08:00
commit 6bf949949c
7923 changed files with 1369582 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import { fileURLToPath, URL } from 'node:url'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
// 开发环境:/api 反向代理到本地 FastAPI(http://localhost:8000)
// 生产环境:由 nginx 托管构建产物,并将 /api 反代到后端
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
server: {
port: 5173,
proxy: {
'/api': {
target: 'http://localhost:8000',
changeOrigin: true,
},
// 本地文件存储(头像/封面):/static → 后端 uploads 目录
'/static': {
target: 'http://localhost:8000',
changeOrigin: true,
},
},
},
})