File tree Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 33 * @returns {Object }
44 */
55function param2Obj ( url ) {
6- const search = url . split ( '?' ) [ 1 ]
6+ const search = decodeURIComponent ( url . split ( '?' ) [ 1 ] ) . replace ( / \+ / g , ' ' )
77 if ( ! search ) {
88 return { }
99 }
10- return JSON . parse (
11- '{"' +
12- decodeURIComponent ( search )
13- . replace ( / " / g, '\\"' )
14- . replace ( / & / g, '","' )
15- . replace ( / = / g, '":"' )
16- . replace ( / \+ / g, ' ' ) +
17- '"}'
18- )
10+ const obj = { }
11+ const searchArr = search . split ( '&' )
12+ searchArr . forEach ( v => {
13+ const index = v . indexOf ( '=' )
14+ if ( index !== - 1 ) {
15+ const name = v . substring ( 0 , index )
16+ const val = v . substring ( index + 1 , v . length )
17+ obj [ name ] = val
18+ }
19+ } )
20+ return obj
1921}
2022
2123/**
Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ export const asyncRoutes = [
204204 path : 'create' ,
205205 component : ( ) => import ( '@/views/example/create' ) ,
206206 name : 'CreateArticle' ,
207- meta : { title : 'Create Article' , icon : 'el-icon-s-help ' }
207+ meta : { title : 'Create Article' , icon : 'edit ' }
208208 } ,
209209 {
210210 path : 'edit/:id(\\d+)' ,
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ module.exports = {
5353 // config.plugins.delete('preload')
5454
5555 // when there are many pages, it will cause too many meaningless requests
56- config . plugins . delete ( 'prefetch' ) //
56+ config . plugins . delete ( 'prefetch' )
5757
5858 // set svg-sprite-loader
5959 config . module
You can’t perform that action at this time.
0 commit comments