Skip to content

Commit 23205c7

Browse files
committed
try fix route error
1 parent e92ba04 commit 23205c7

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@
55
<link rel="icon" type="image/png" href="/logo.png" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Open Courses | KrimsonSquad</title>
8+
<script type="text/javascript">
9+
(function(l) {
10+
if (l.search[1] === '/' ) {
11+
var decoded = l.search.slice(1).split('&').map(function(s) {
12+
return s.replace(/~and~/g, '&')
13+
}).join('?');
14+
window.history.replaceState(null, null,
15+
l.pathname.slice(0, -1) + decoded + l.hash
16+
);
17+
}
18+
}(window.location))
19+
</script>
820
</head>
921
<body>
1022
<div id="root"></div>

public/404.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>OpenCourse | KrimsonSquad</title>
6+
<script type="text/javascript">
7+
var pathSegmentsToKeep = 1;
8+
9+
var l = window.location;
10+
l.replace(
11+
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
12+
l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' +
13+
l.pathname.slice(1).split('/').slice(pathSegmentsToKeep).join('/').replace(/&/g, '~and~') +
14+
(l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') +
15+
l.hash
16+
);
17+
18+
</script>
19+
</head>
20+
<body>
21+
</body>
22+
</html>

public/vite.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)