|
|
|
@ -42,22 +42,22 @@ const baseCfg = (viteEnv = {}) => { |
|
|
|
open: false, |
|
|
|
cors: true, |
|
|
|
proxy: { |
|
|
|
'/efcode20-ent-app/api/ent-ep': { |
|
|
|
target: VITE_PROXY_TARGET ||'http://139.186.148.21:8080', |
|
|
|
changeOrigin: true, |
|
|
|
rewrite: (path) => path.replace(/^\/efcode20-ent-app\/api\/ent-ep/, ''), |
|
|
|
configure: (proxy) => { |
|
|
|
proxy.on('proxyReq', (proxyReq, req) => { |
|
|
|
console.log(`[Proxy] ${req.method} ${req.url} → ${proxyReq.protocol}//${proxyReq.host}${proxyReq.path}`); |
|
|
|
}); |
|
|
|
proxy.on('proxyRes', (proxyRes, req) => { |
|
|
|
console.log(`[Proxy] ${proxyRes.statusCode} ← ${req.method} ${req.url}`); |
|
|
|
}); |
|
|
|
proxy.on('error', (err, req) => { |
|
|
|
console.error(`[Proxy Error] ${req.method} ${req.url}`, err.message); |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
// '/efcode20-ent-app/api/ent-ep': {
|
|
|
|
// target: VITE_PROXY_TARGET ||'http://139.186.148.21:8080',
|
|
|
|
// changeOrigin: true,
|
|
|
|
// rewrite: (path) => path.replace(/^\/efcode20-ent-app\/api\/ent-ep/, ''),
|
|
|
|
// configure: (proxy) => {
|
|
|
|
// proxy.on('proxyReq', (proxyReq, req) => {
|
|
|
|
// console.log(`[Proxy] ${req.method} ${req.url} → ${proxyReq.protocol}//${proxyReq.host}${proxyReq.path}`);
|
|
|
|
// });
|
|
|
|
// proxy.on('proxyRes', (proxyRes, req) => {
|
|
|
|
// console.log(`[Proxy] ${proxyRes.statusCode} ← ${req.method} ${req.url}`);
|
|
|
|
// });
|
|
|
|
// proxy.on('error', (err, req) => {
|
|
|
|
// console.error(`[Proxy Error] ${req.method} ${req.url}`, err.message);
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
'/efcode20-ent-app/api': { |
|
|
|
target: VITE_PROXY_TARGET ||'http://139.186.148.21:8080', |
|
|
|
changeOrigin: true, |
|
|
|
@ -76,7 +76,12 @@ const baseCfg = (viteEnv = {}) => { |
|
|
|
}, |
|
|
|
'/profile': { |
|
|
|
target: VITE_PROXY_TARGET || 'http://139.186.148.21:8080', |
|
|
|
rewrite: (path) => path.replace(/^\/profile/, '/ent-ep/profile'), |
|
|
|
rewrite: (path) => { |
|
|
|
if (VITE_BASE_URL.includes('ent-ep')) { |
|
|
|
return path.replace(/^\/profile/, '/ent-ep/profile'); |
|
|
|
} |
|
|
|
return path.replace(/^\/profile/, '/profile') |
|
|
|
}, |
|
|
|
changeOrigin: true, |
|
|
|
} |
|
|
|
} |
|
|
|
|