后台:上传资源

This commit is contained in:
luying
2021-12-17 19:17:05 +08:00
parent 8c966aaed7
commit 07e12ccf9e
10 changed files with 110 additions and 24 deletions
+19 -1
View File
@@ -22,7 +22,25 @@ export default (appInfo: EggAppInfo) => {
url: '127.0.0.1', // 内网
pw: ''
};
config.proxy = {};
let regions = [ // 大区数据
{ id: 1, env: 'test', name: "测试", domain: 'http://127.0.0.1:7002' },
];
config.regions = regions;
let httpProxy: any = {};
for(let { env, domain } of regions) {
httpProxy[`/api/${env}`] = {
target: domain,
changeOrigin: true,
secure: true,
pathRewrite: function(path) {
console.log('proxy', path, path.replace(`/api/${env}`, '/api'))
return path.replace(`/api/${env}`, '/api')
}
}
}
config.proxy = httpProxy;
// the return config will combines to EggAppConfig
return {