Skip to content

Commit 4ef0782

Browse files
committed
chore: use mockjs in production environment
1 parent 0bf339b commit 4ef0782

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/main.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@ import * as filters from './filters' // global filters
2121

2222
/**
2323
* If you don't want to use mock-server
24-
* you want to use mockjs for request interception
25-
* you can execute:
24+
* you want to use MockJs for mock api
25+
* you can execute: mockXHR()
2626
*
27-
* import { mockXHR } from '../mock'
28-
* mockXHR()
27+
* Currently MockJs will be used in the production environment,
28+
* please remove it before going online! ! !
2929
*/
30+
import { mockXHR } from '../mock'
31+
if (process.env.NODE_ENV === 'production') {
32+
mockXHR()
33+
}
3034

3135
Vue.use(Element, {
3236
size: Cookies.get('size') || 'medium' // set element-ui default size

0 commit comments

Comments
 (0)