24 lines
772 B
HTML
24 lines
772 B
HTML
|
|
<!DOCTYPE html>
|
|||
|
|
<html>
|
|||
|
|
<head>
|
|||
|
|
<meta charset="utf-8">
|
|||
|
|
<title>Redirecting...</title>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
// GitHub Pages的单页应用重定向方案
|
|||
|
|
// 当访问子路由时,将路径信息保存到sessionStorage,然后重定向到index.html
|
|||
|
|
var pathSegmentsToKeep = 1;
|
|||
|
|
|
|||
|
|
var l = window.location;
|
|||
|
|
l.replace(
|
|||
|
|
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
|
|||
|
|
l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' +
|
|||
|
|
l.pathname.slice(1).split('/').slice(pathSegmentsToKeep).join('/').replace(/&/g, '~and~') +
|
|||
|
|
(l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') +
|
|||
|
|
l.hash
|
|||
|
|
);
|
|||
|
|
</script>
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
</body>
|
|||
|
|
</html>
|