From c701f75ac695627e3dc1017863588a8be34cd0d8 Mon Sep 17 00:00:00 2001 From: harrywan Date: Fri, 22 Oct 2021 17:43:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fixbug:=20=E4=BF=AE=E5=A4=8Dmock=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fes-cli/build/helpers/createDevServer.js | 5 ++--- packages/fes-cli/build/helpers/createMock.js | 4 ---- packages/fes-cli/package.json | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/fes-cli/build/helpers/createDevServer.js b/packages/fes-cli/build/helpers/createDevServer.js index eef03686..ec57707c 100644 --- a/packages/fes-cli/build/helpers/createDevServer.js +++ b/packages/fes-cli/build/helpers/createDevServer.js @@ -17,9 +17,6 @@ module.exports = function createDevServer(port, defaultConfig) { const app = express(); - // 初始化Mock数据 - createMock(app); - const compiler = webpack(defaultConfig); // devServer 自带支持,添加自定义插件。 @@ -43,6 +40,8 @@ module.exports = function createDevServer(port, defaultConfig) { })); app.use('/static', express.static('src/static')); + // 初始化Mock数据 + createMock(app); opn(`http://localhost:${port}`); diff --git a/packages/fes-cli/build/helpers/createMock.js b/packages/fes-cli/build/helpers/createMock.js index fcf226ec..d12f22d9 100644 --- a/packages/fes-cli/build/helpers/createMock.js +++ b/packages/fes-cli/build/helpers/createMock.js @@ -15,7 +15,6 @@ const util = require('./util'); const router = express.Router(); - // 根据参数个数获取配置 function getOption(arg) { const len = arg.length; @@ -145,9 +144,6 @@ const createMock = function () { proxy.on('error', (e) => { log.error(e); }); - proxy.on('proxyReq', (proxyReq) => { - proxyReq.setHeader('Host', url.parse(host).host); - }); process.nextTick(() => { router.use((req, res) => { proxy.web(req, res, { diff --git a/packages/fes-cli/package.json b/packages/fes-cli/package.json index ea3cee9c..53f4c155 100644 --- a/packages/fes-cli/package.json +++ b/packages/fes-cli/package.json @@ -1,6 +1,6 @@ { "name": "@webank/fes-cli", - "version": "0.4.6", + "version": "0.4.7", "description": "一个好用的前端管理台快速开发框架", "preferGlobal": true, "scripts": { From c105a6efa176e39710f951e23f950da003a316e8 Mon Sep 17 00:00:00 2001 From: harrywan Date: Fri, 22 Oct 2021 17:46:10 +0800 Subject: [PATCH 2/2] feat: fes-cli@0.4.8 --- packages/fes-cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fes-cli/package.json b/packages/fes-cli/package.json index 53f4c155..e16a3a05 100644 --- a/packages/fes-cli/package.json +++ b/packages/fes-cli/package.json @@ -1,6 +1,6 @@ { "name": "@webank/fes-cli", - "version": "0.4.7", + "version": "0.4.8", "description": "一个好用的前端管理台快速开发框架", "preferGlobal": true, "scripts": {