提交 ca51beb6 编写于 作者: fxy060608's avatar fxy060608

fix: remove encodeQueryString

上级 be9f6386
import getRealRoute from '../get-real-route'
function encodeQueryString (url) {
if (typeof url === 'string') {
const urls = url.split('?')
url = urls[0]
const params = [];
(urls[1] || '').split('&').forEach(function (pair) {
if (pair) {
const pairs = pair.split('=')
params.push(pairs[0] + '=' + encodeURIComponent(pairs[1]))
}
})
return params.length ? url + '?' + params.join('&') : url
}
return url
}
function createValidator (type) {
return function validator (url, params) {
// 格式化为绝对路径路由
......@@ -55,9 +36,6 @@ function createValidator (type) {
if (routeOptions.meta.isEntry) {
url = url.replace(routeOptions.alias, '/')
}
// 参数格式化
params.url = encodeQueryString(url)
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册