This commit is contained in:
2026-08-21 17:20:51 +08:00
parent 8f80b90fc4
commit 641ea7f628
47 changed files with 130068 additions and 32 deletions
+12
View File
@@ -8,8 +8,10 @@ import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
const proxyTarget = process.env.API_PROXY_TARGET || env.API_PROXY_TARGET || 'http://127.0.0.1:9000'
const overseasProxyTarget = process.env.OVERSEAS_API_PROXY_TARGET || env.OVERSEAS_API_PROXY_TARGET || 'http://127.0.0.1:9300'
return {
cacheDir: 'tmp/vite-cache',
plugins: [
vue(),
AutoImport({
@@ -38,6 +40,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')
})
},
},
},
},
}