diff --git a/config/config.js b/config/config.js index 88b4605..99f1e52 100644 --- a/config/config.js +++ b/config/config.js @@ -1,4 +1,5 @@ import {defineConfig} from 'umi'; +import proxy from './proxy'; export default defineConfig({ publicPath: "./", @@ -9,6 +10,6 @@ export default defineConfig({ hash: true, history: { type: "browser" - } - + }, + proxy }); diff --git a/config/proxy.js b/config/proxy.js new file mode 100644 index 0000000..1c6dd02 --- /dev/null +++ b/config/proxy.js @@ -0,0 +1,21 @@ +/** + * 在生产环境 代理是无法生效的,所以这里没有生产环境的配置 + * The agent cannot take effect in the production environment + * so there is no configuration of the production environment + * For details, please see + * https://pro.ant.design/docs/deploy + */ + + //线上 +const serverApi = 'http://localhost:8100'; +// const serverApi = 'http://192.168.3.128:8100'; + + +export default { + '/manager': {target: serverApi, changeOrigin: true, pathRewrite: {'^': ''}}, + '/tools': {target: serverApi, changeOrigin: true, pathRewrite: {'^': ''}}, + '/ops': {target: serverApi, changeOrigin: true, pathRewrite: {'^': ''}}, + '/auth': {target: serverApi, changeOrigin: true, pathRewrite: {'^': ''}}, + '/organ': {target: serverApi, changeOrigin: true, pathRewrite: {'^': ''}}, + '/common': {target: serverApi, changeOrigin: true, pathRewrite: {'^': ''}}, +};