优化
This commit is contained in:
+5
-2
@@ -27,7 +27,7 @@ export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '')
|
||||
const apiTarget = env.API_PROXY_TARGET || 'http://127.0.0.1:9000'
|
||||
return {
|
||||
base: process.env.UNI_PLATFORM === 'h5' && mode === 'production' ? '/pda-overseas/' : undefined,
|
||||
base: process.env.UNI_PLATFORM === 'h5' && mode === 'production' ? '/' : undefined,
|
||||
plugins: [uni()],
|
||||
define: {
|
||||
'import.meta.env.VITE_PDA_UPDATE_URL': JSON.stringify(env.VITE_PDA_UPDATE_URL || ''),
|
||||
@@ -40,7 +40,10 @@ export default defineConfig(({ mode }) => {
|
||||
},
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': loggedProxy('api', { target: apiTarget, changeOrigin: true })
|
||||
'/gateway-api': loggedProxy('api', {
|
||||
target: apiTarget, changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/gateway-api/, '/api')
|
||||
})
|
||||
}
|
||||
},
|
||||
css: {
|
||||
|
||||
Reference in New Issue
Block a user