From a4e038310ef53b0074c267dd5b3034874e26998b Mon Sep 17 00:00:00 2001 From: balibabu <cike8899@users.noreply.github.com> Date: Thu, 29 Feb 2024 10:00:45 +0800 Subject: [PATCH] feat: set proxy of backend api (#83) --- web/.umirc.ts | 14 +++++++------- web/src/utils/api.ts | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/web/.umirc.ts b/web/.umirc.ts index ec05621..84afb1a 100644 --- a/web/.umirc.ts +++ b/web/.umirc.ts @@ -21,11 +21,11 @@ export default defineConfig({ hack: `true; @import "~@/less/variable.less";`, }, }, - // proxy: { - // '/v1': { - // 'target': 'http://54.80.112.79:9380/', - // 'changeOrigin': true, - // 'pathRewrite': { '^/v1': '/v1' }, - // }, - // }, + proxy: { + '/v1': { + target: 'http://123.60.95.134:9380/', + changeOrigin: true, + // pathRewrite: { '^/v1': '/v1' }, + }, + }, }); diff --git a/web/src/utils/api.ts b/web/src/utils/api.ts index 3a1169e..033c906 100644 --- a/web/src/utils/api.ts +++ b/web/src/utils/api.ts @@ -1,4 +1,4 @@ -let api_host = `http://123.60.95.134:9380/v1`; +let api_host = `/v1`; export { api_host }; -- GitLab