File tree 1 file changed +14
-14
lines changed
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) {
162
162
* @returns {Object }
163
163
*/
164
164
export 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
168
177
}
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
180
180
}
181
181
182
182
/**
You can’t perform that action at this time.
0 commit comments