function parse_url_pathinfo(str) {
var _arr = str.replace(/[\?|#]/g, "").split('/').filter(Boolean);
var res = {};
for (var i=0;i<_arr.length;i+=2) {
res[_arr[i]]=_arr[i+1] || ''
}
return res;
}
var str = '?mch_id/b/token/d/name/中国/sex/男/err///';
console.log(parse_url_pathinfo(str))
err: ""
mch_id: "b"
name: "中国"
sex: "男"
token: "d"