mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-23 23:39:47 +08:00
refactor(projects): 请求适配器函数范型重构、优化请求相关的命名
This commit is contained in:
@ -9,10 +9,15 @@ export function createViteProxy(isOpenProxy: boolean, envConfig: ServiceEnvConfi
|
||||
if (!isOpenProxy) return undefined;
|
||||
|
||||
const proxy: Record<string, string | ProxyOptions> = {
|
||||
[envConfig.proxy]: {
|
||||
[envConfig.pattern]: {
|
||||
target: envConfig.url,
|
||||
changeOrigin: true,
|
||||
rewrite: path => path.replace(new RegExp(`^${envConfig.proxy}`), '')
|
||||
rewrite: path => path.replace(new RegExp(`^${envConfig.pattern}`), '')
|
||||
},
|
||||
[envConfig.pattern]: {
|
||||
target: envConfig.secondUrl,
|
||||
changeOrigin: true,
|
||||
rewrite: path => path.replace(new RegExp(`^${envConfig.pattern}`), '')
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user