File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -162,21 +162,21 @@ export function param(json) {
162162 * @returns {Object }
163163 */
164164export function param2Obj ( url ) {
165- const search = decodeURIComponent ( url . split ( '?' ) [ 1 ] ) . replace ( / \+ / g, ' ' )
166- if ( ! search ) {
167- return { }
165+ const search = decodeURIComponent ( url . split ( '?' ) [ 1 ] ) . replace ( / \+ / g, ' ' )
166+ if ( ! search ) {
167+ return { }
168+ }
169+ const obj = { }
170+ const searchArr = search . split ( '&' )
171+ searchArr . forEach ( v => {
172+ const index = v . indexOf ( '=' )
173+ if ( index !== - 1 ) {
174+ const name = v . substring ( 0 , index )
175+ const val = v . substring ( index + 1 , v . length )
176+ obj [ name ] = val
168177 }
169- const obj = { }
170- const searchArr = search . split ( '&' )
171- searchArr . forEach ( v => {
172- const index = v . indexOf ( '=' )
173- if ( index !== - 1 ) {
174- const name = v . substring ( 0 , index )
175- const val = v . substring ( index + 1 , v . length )
176- obj [ name ] = val
177- }
178- } )
179- return obj
178+ } )
179+ return obj
180180}
181181
182182/**
You can’t perform that action at this time.
0 commit comments