chore(dev): move local API default port to 3010

Avoid conflict with another local service on 3000; align Vite proxies and docs.
This commit is contained in:
2026-08-07 21:03:23 +08:00
parent 21d44026d9
commit 8f83624ffe
13 changed files with 18 additions and 16 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ export default defineConfig(async () => ({
plugins: ['@tarojs/plugin-html'],
defineConstants: {
/** H5 静态托管无 /api 代理时直连后端;dev 构建可通过 VITE_API_TARGET 覆盖 */
TARO_APP_API_ORIGIN: JSON.stringify(process.env.VITE_API_TARGET ?? 'http://localhost:3000'),
TARO_APP_API_ORIGIN: JSON.stringify(process.env.VITE_API_TARGET ?? 'http://localhost:3010'),
},
copy: {
patterns: [],
@@ -44,7 +44,7 @@ export default defineConfig(async () => ({
host: '0.0.0.0',
proxy: {
'/api': {
target: process.env.VITE_API_TARGET ?? 'http://localhost:3000',
target: process.env.VITE_API_TARGET ?? 'http://localhost:3010',
changeOrigin: true,
},
},