This commit is contained in:
2026-08-20 09:10:36 +08:00
parent 033b5df6b6
commit 508f76924e
58 changed files with 1790 additions and 628 deletions
+11
View File
@@ -8,6 +8,7 @@ import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
const proxyTarget = env.API_PROXY_TARGET || 'http://localhost:8080'
const overseasProxyTarget = env.OVERSEAS_API_PROXY_TARGET || 'http://localhost:9300'
return {
plugins: [
@@ -38,6 +39,16 @@ export default defineConfig(({ mode }) => {
})
},
},
'/overseas-api': {
target: overseasProxyTarget,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/overseas-api/, '/api'),
configure(proxy) {
proxy.on('proxyReq', (proxyRequest) => {
proxyRequest.removeHeader('origin')
})
},
},
},
},
}