From 4ef0782189004e98cf427fd5eafc908d0a14a7d6 Mon Sep 17 00:00:00 2001 From: Pan Date: Fri, 10 May 2019 14:47:57 +0800 Subject: [PATCH] chore: use mockjs in production environment --- src/main.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main.js b/src/main.js index 205b3c84..ef07f389 100644 --- a/src/main.js +++ b/src/main.js @@ -21,12 +21,16 @@ import * as filters from './filters' // global filters /** * If you don't want to use mock-server - * you want to use mockjs for request interception - * you can execute: + * you want to use MockJs for mock api + * you can execute: mockXHR() * - * import { mockXHR } from '../mock' - * mockXHR() + * Currently MockJs will be used in the production environment, + * please remove it before going online! ! ! */ +import { mockXHR } from '../mock' +if (process.env.NODE_ENV === 'production') { + mockXHR() +} Vue.use(Element, { size: Cookies.get('size') || 'medium' // set element-ui default size