@@ -48,8 +48,11 @@ export default [
4848 const pageList = mockList . filter ( ( item , index ) => index < limit * page && index >= limit * ( page - 1 ) )
4949
5050 return {
51- total : mockList . length ,
52- items : pageList
51+ code : '20000' ,
52+ data : {
53+ total : mockList . length ,
54+ items : pageList
55+ }
5356 }
5457 }
5558 } ,
@@ -61,7 +64,10 @@ export default [
6164 const { id } = config . query
6265 for ( const article of List ) {
6366 if ( article . id === + id ) {
64- return article
67+ return {
68+ code : '20000' ,
69+ data : article
70+ }
6571 }
6672 }
6773 }
@@ -71,12 +77,16 @@ export default [
7177 url : '/article/pv' ,
7278 type : 'get' ,
7379 response : _ => {
74- return { pvData : [
75- { key : 'PC' , pv : 1024 } ,
76- { key : 'mobile' , pv : 1024 } ,
77- { key : 'ios' , pv : 1024 } ,
78- { key : 'android' , pv : 1024 }
79- ]
80+ return {
81+ code : '20000' ,
82+ data : {
83+ pvData : [
84+ { key : 'PC' , pv : 1024 } ,
85+ { key : 'mobile' , pv : 1024 } ,
86+ { key : 'ios' , pv : 1024 } ,
87+ { key : 'android' , pv : 1024 }
88+ ]
89+ }
8090 }
8191 }
8292 } ,
@@ -86,6 +96,7 @@ export default [
8696 type : 'post' ,
8797 response : _ => {
8898 return {
99+ code : '20000' ,
89100 data : 'success'
90101 }
91102 }
@@ -96,6 +107,7 @@ export default [
96107 type : 'post' ,
97108 response : _ => {
98109 return {
110+ code : '20000' ,
99111 data : 'success'
100112 }
101113 }
0 commit comments