fix: admin dev 代理补齐短链 /t 与 /trace,本地对齐生产单入口

- 5173 开发服务此前未代理 /t 和 /trace,短链在本地无法打开
- /t 转发 API 302 跳转、/trace 转发 C 端 dev server,实测完整链路打通
This commit is contained in:
Nixevol
2026-07-10 09:57:05 +08:00
parent 3955065fbb
commit 6813d5bb34
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -55,9 +55,13 @@ export default defineConfig({
server: {
port: 5173,
host: true,
// dev 下把 5173 打造成与生产一致的「单入口」:/api、/uploads、短链 /t 走 API,/trace 走 C 端 dev server。
// 生产由 API 单端口托管全部路径,短链 {BASE_URL}/t/xxx 天然可用;此处让本地行为对齐。
proxy: {
'/api': { target: 'http://localhost:3000', changeOrigin: true, configure: onProxyError },
'/uploads': { target: 'http://localhost:3000', changeOrigin: true },
'^/t/.*': { target: 'http://localhost:3000', changeOrigin: true },
'/trace': { target: 'http://localhost:5174', changeOrigin: true, ws: true },
},
},
build: {