From 7c2e817088e096f5b69471730f55f7a94da82db0 Mon Sep 17 00:00:00 2001 From: Tevin <tingquanren@163.com> Date: Tue, 21 Mar 2023 16:19:52 +0800 Subject: [PATCH] 允许关闭mock,使用post请求本地模拟接口 --- bases/HostBoot.js | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/bases/HostBoot.js b/bases/HostBoot.js index 6907708..83aefda 100644 --- a/bases/HostBoot.js +++ b/bases/HostBoot.js @@ -14,6 +14,7 @@ */ constructor() { this._data = { + mockOff: Tools.getUrlParam('mock') === 'off', // 可用主机列表 hostList: { ...project.host.hosts, @@ -52,7 +53,7 @@ }; } // 如果有匹配服务器,使用指定的服务器地址 - if (typeof this._data.hostList[server] !== 'undefined') { + else if (typeof this._data.hostList[server] !== 'undefined') { this._data.activeHost[typeName] = { name: server, host: this._data.hostList[server], @@ -193,6 +194,9 @@ */ isOnMock() { if (this.isDevMod()) { + if (this._data.mockOff) { + return false; + } return this.getHostName() === 'lc'; } else { return false; -- Gitblit v1.9.1