Skip to content

Commit 8a0b33f

Browse files
committed
Merge pull request #391 from byrdkm17/dev
修复 url 参数二次 encode 的问题
2 parents a36f596 + cf759ff commit 8a0b33f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,9 @@ class Router {
582582
if (path.query) {
583583
params.queryParams = path.query
584584
}
585-
fullPath = this._recognizer.generate(path.name, params)
585+
fullPath = encodeURI(this._recognizer.generate(path.name, params))
586586
} else if (path.path) {
587-
fullPath = path.path
587+
fullPath = encodeURI(path.path)
588588
if (path.query) {
589589
const query = this._recognizer.generateQueryString(path.query)
590590
if (fullPath.indexOf('?') > -1) {
@@ -595,9 +595,9 @@ class Router {
595595
}
596596
}
597597
} else {
598-
fullPath = path ? path + '' : ''
598+
fullPath = encodeURI(path ? path + '' : '')
599599
}
600-
return encodeURI(fullPath)
600+
return fullPath
601601
}
602602
}
603603

0 commit comments

Comments
 (0)