Closed medici closed 7 years ago
If I get a url like http://www.exmaple.com/home#!/message?=c=c&d=d., and I share it to the wechat app, the app will auto add params to the url like http://www.exmaple.com/home?a=a&b=b#!/message?=c=c&d=d. I will get the params as : {c:'c', d: 'd?a', b: 'b'}, and the process will catch a error. I resovle this question with:
function getInitialPath(component) { var path = component.props.path || component.context.path, hash, url; if (!path && detect.canUseDOM) { url = urllite(window.location.href); if (component.props.history) { path = url.pathname + url.search; } else if (url.hash) { hash = urllite(url.hash.slice(2)); path = hash.pathname + hash.search; if(window.location.search) { path = hash.pathname + hash.search + window.location.search.replace('?', '&'); } else { } } } return path || '/'; }
If you can submit a pull request with tests to resolve the error I'll happily merge and push an update to NPM.
No response from @medici. Closing.
If I get a url like http://www.exmaple.com/home#!/message?=c=c&d=d., and I share it to the wechat app, the app will auto add params to the url like http://www.exmaple.com/home?a=a&b=b#!/message?=c=c&d=d. I will get the params as : {c:'c', d: 'd?a', b: 'b'}, and the process will catch a error. I resovle this question with: