Skip to content

Commit ac4865a

Browse files
committed
chore: use mockjs in production environment
1 parent 9793fff commit ac4865a

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
@@ -17,12 +17,16 @@ import '@/permission' // permission control
1717

1818
/**
1919
* If you don't want to use mock-server
20-
* you want to use mockjs for request interception
21-
* you can execute:
20+
* you want to use MockJs for mock api
21+
* you can execute: mockXHR()
2222
*
23-
* import { mockXHR } from '../mock'
24-
* mockXHR()
23+
* Currently MockJs will be used in the production environment,
24+
* please remove it before going online! ! !
2525
*/
26+
import { mockXHR } from '../mock'
27+
if (process.env.NODE_ENV === 'production') {
28+
mockXHR()
29+
}
2630

2731
// set ElementUI lang to EN
2832
Vue.use(ElementUI, { locale })

0 commit comments

Comments
 (0)