mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-23 23:39:47 +08:00
fix(projects): 修复多个后端服务时的本地代理
This commit is contained in:
@ -9,15 +9,15 @@ export function createViteProxy(isOpenProxy: boolean, envConfig: ServiceEnvConfi
|
||||
if (!isOpenProxy) return undefined;
|
||||
|
||||
const proxy: Record<string, string | ProxyOptions> = {
|
||||
[envConfig.pattern]: {
|
||||
[envConfig.urlPattern]: {
|
||||
target: envConfig.url,
|
||||
changeOrigin: true,
|
||||
rewrite: path => path.replace(new RegExp(`^${envConfig.pattern}`), '')
|
||||
rewrite: path => path.replace(new RegExp(`^${envConfig.urlPattern}`), '')
|
||||
},
|
||||
[envConfig.pattern]: {
|
||||
[envConfig.secondUrlPattern]: {
|
||||
target: envConfig.secondUrl,
|
||||
changeOrigin: true,
|
||||
rewrite: path => path.replace(new RegExp(`^${envConfig.pattern}`), '')
|
||||
rewrite: path => path.replace(new RegExp(`^${envConfig.secondUrlPattern}`), '')
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user