后台:处理proxy

This commit is contained in:
luying
2021-12-30 15:28:08 +08:00
parent 4e63b109ae
commit 6e881bc9c7
3 changed files with 32 additions and 13 deletions
+8
View File
@@ -23,6 +23,14 @@ export default class FooBoot implements IBoot {
if(this.app.config.env == 'local') {
this.app.config.realEnv = 'development';
}
// 如果gm使用的就是本机代理,host不转发到target而只把path替换
if(this.app.config.httpProxy && this.app.config.httpProxy[`/web/${this.app.config.realEnv}/`]) {
this.app.config.httpProxy[`/web/${this.app.config.realEnv}/`].changeOrigin = false;
}
if(this.app.config.httpProxy && this.app.config.httpProxy[`/api/${this.app.config.realEnv}/`]) {
this.app.config.httpProxy[`/api/${this.app.config.realEnv}/`].changeOrigin = false;
}
}
configDidLoad() {