Skip to content

Commit 9473fbb

Browse files
committed
added remove base
1 parent 8b23339 commit 9473fbb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/libs/redirect.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {config} from '@/client_config.js'
2+
import { remove_base } from './client_utils'
23

34
export async function redirectToFullUrl() {
45
if(document.title == "not found"){
@@ -9,7 +10,10 @@ export async function redirectToFullUrl() {
910

1011
const response = await fetch(`${config.base}/api/redirect`)
1112
const redirects = await response.json()
12-
let pathname = window.location.pathname.substring(1)
13+
let pathname = remove_base(window.location.pathname)
14+
if(pathname.startsWith("/")){
15+
pathname = pathname.substring(1)
16+
}
1317
if (pathname in redirects) {
1418
const new_url = redirects[pathname]
1519
if(new_url){

0 commit comments

Comments
 (0)