diff --git a/apps/jingrow/frontend/vite.config.ts b/apps/jingrow/frontend/vite.config.ts index 190fc01..27aad87 100644 --- a/apps/jingrow/frontend/vite.config.ts +++ b/apps/jingrow/frontend/vite.config.ts @@ -54,8 +54,6 @@ export default defineConfig(({ mode, command }) => { const filesDir = command === 'serve' ? path.resolve(currentDir, '..', 'jingrow', 'public', 'files') : null return { - // 生产环境使用完整路径,开发环境使用根路径 - base: command === 'build' ? '/assets/jingrow/frontend/' : '/', plugins: [ vue(), Icons({ @@ -110,8 +108,8 @@ export default defineConfig(({ mode, command }) => { allow: [appsDir] }, proxy: { - // 使用正则批量匹配多个路由 - '^/(api|assets|files|private)': { + // jlocal 只代理 API 请求,静态资源由 vite/Caddy 直接托管 + '^/api': { target: BACKEND_URL, changeOrigin: true, secure: false, diff --git a/package.json b/package.json index fdb0704..aecb67d 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "install:backend": "bash -lc 'cd apps/jingrow && if [ -f pyproject.toml ]; then uv sync; elif [ -f requirements.txt ]; then uv pip install -r requirements.txt; else echo \"No dependency manifest found\"; fi'", "build": "npm run build:frontend", "build:frontend": "cd apps/jingrow/frontend && npm run build", - "start": "npm run start:frontend && npm run start:backend", + "start": "concurrently --names \"BACKEND,FRONTEND\" --prefix-colors \"blue,green\" \"npm run start:backend\" \"sleep 3 && npm run start:frontend\"", "start:frontend": "cd apps/jingrow/frontend && npm run preview", "start:backend": "cd apps/jingrow && uv run uvicorn jingrow.main:app --host 0.0.0.0 --port 9001", "clean": "npm run clean:frontend && npm run clean:backend",