File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "code" :0 ,
3+ "message" :" Permintaan berhasil" ,
4+ "result" :[
5+ {
6+ "id" :1 ,
7+ "name" :" Demo1" ,
8+ "parentId" :-1 ,
9+ "path" :" demo1"
10+ },
11+ {
12+ "id" :2 ,
13+ "name" :" Demo11" ,
14+ "parentId" :1 ,
15+ "path" :" demo1.demo11"
16+ },
17+ {
18+ "id" :3 ,
19+ "name" :" Demo12" ,
20+ "parentId" :1 ,
21+ "path" :" demo1.demo12"
22+ },
23+ {
24+ "id" :4 ,
25+ "name" :" demo2" ,
26+ "parentId" :-1 ,
27+ "path" :" demo2"
28+ }
29+ ]
30+ }
Original file line number Diff line number Diff line change 11const path = require ( 'path' ) ;
22const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
33const pjson = require ( './package.json' ) ;
4+
5+ // 模拟菜单
6+ const menuList = require ( './menus.json' ) ;
47// 自定义webpack
58module . exports = {
69 outputDir : path . join ( __dirname , './dist' , pjson . name ) ,
10+ // 配置模拟数据接口
11+ devServer : {
12+ compress : false , // 开启压缩
13+ before ( app ) {
14+ app . get ( '/api/v1/menu' , ( req , res ) => {
15+ res . json ( menuList )
16+ } )
17+ } ,
18+ } ,
719 configureWebpack : ( config ) => {
820 const env = process . env . NODE_ENV ;
921 switch ( env ) {
You can’t perform that action at this time.
0 commit comments