Skip to content

Commit

Permalink
fix: 修复decodeParams返回数据格式错误问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhenfei committed Sep 27, 2020
1 parent 9c2ab50 commit c746df2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/navi.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ export const urlToObj = (str = '', decodeURI) => {
* @param {Object} params params
*/
export const decodeParams = params => {
const convertObject = Object.keys(params).map(paramObject => ({
[paramObject]: decodeURIComponent(params[paramObject])
}))
const convertObject = {}
for (const paramObject of Object.keys(params)) {
convertObject[paramObject] = decodeURIComponent(params[paramObject])
}
return convertObject
}

Expand Down

0 comments on commit c746df2

Please sign in to comment.