fix 404 redirect

This commit is contained in:
afc163 2016-05-10 19:13:53 +08:00
parent 45c98fdad2
commit 4f44b32ffa

View File

@ -1,8 +1,8 @@
<script>
var prefix = /^\/components/.test(location.pathname) ? location.pathname.replace(/^\//, '').split('/').join('-') : '';
if (location.pathname === '/changelog') {
location.href = '/#/docs/react/' + location.pathname.replace(/\/?#/, '?scrollTo=' + prefix);
location.href = '/#/docs/react/changelog?scrollTo=' + location.hash;
} else {
location.href = '/#' + location.pathname.replace(/\/?#/, '?scrollTo=' + prefix);
location.href = '/#' + location.pathname + '?scrollTo=' + prefix + location.hash;
}
</script>