diff --git a/zdxt-web-client/zdxt-efcode-enforcement-app/vite-config/index.js b/zdxt-web-client/zdxt-efcode-enforcement-app/vite-config/index.js index c30de1dc..32f981c7 100644 --- a/zdxt-web-client/zdxt-efcode-enforcement-app/vite-config/index.js +++ b/zdxt-web-client/zdxt-efcode-enforcement-app/vite-config/index.js @@ -43,11 +43,11 @@ const baseCfg = (viteEnv = {}) => { cors: true, proxy: { //适配外网的测试环境临时使用 - '/efcode20-enf-app/api/enf-ep': { - target: VITE_PROXY_TARGET || 'http://localhost:17000', - changeOrigin: true, - rewrite: (path) => path.replace(/^\/efcode20-enf-app\/api\/enf-ep/, ''), - }, + // '/efcode20-enf-app/api/enf-ep': { + // target: VITE_PROXY_TARGET || 'http://localhost:17000', + // changeOrigin: true, + // rewrite: (path) => path.replace(/^\/efcode20-enf-app\/api\/enf-ep/, ''), + // }, '/efcode20-enf-app/api': { target: VITE_PROXY_TARGET || 'http://localhost:17000', changeOrigin: true, @@ -55,7 +55,12 @@ const baseCfg = (viteEnv = {}) => { }, '/profile': { target: VITE_PROXY_TARGET || 'http://139.186.148.21:8080', - rewrite: (path) => path.replace(/^\/profile/, '/ent-ep/profile'), + rewrite: (path) => { + if (VITE_BASE_URL.includes('enf-ep')) { + return path.replace(/^\/profile/, '/enf-ep/profile'); + } + return path.replace(/^\/profile/, '/profile') + }, changeOrigin: true, } } diff --git a/zdxt-web-client/zdxt-efcode-enforcement-app/vite-env/.env.enforcement-dev-wmy b/zdxt-web-client/zdxt-efcode-enforcement-app/vite-env/.env.enforcement-dev-wmy index 1b909320..da35e03e 100644 --- a/zdxt-web-client/zdxt-efcode-enforcement-app/vite-env/.env.enforcement-dev-wmy +++ b/zdxt-web-client/zdxt-efcode-enforcement-app/vite-env/.env.enforcement-dev-wmy @@ -1,6 +1,6 @@ # 执法端测试环境 VITE_PORT = 12002 -VITE_BASE_URL = '/efcode20-enf-app/api/enf-ep' +VITE_BASE_URL = '/efcode20-enf-app/api' VITE_CONTEXT_PATH = '/efcode20-enf-app/' VITE_PROXY_TARGET = 'http://139.186.148.21:8080' VITE_DEFAULT_LOGIN = '/enforcement/loginByPassword'