fix: 404 /subscription/

This commit is contained in:
lisonge 2024-08-16 21:54:40 +08:00
parent 212218324c
commit e8f7e49f82

View File

@ -5,11 +5,15 @@ import components from '../components';
import './custom.css';
// Redirect /selector/* to /guide/*
if (!import.meta.env.SSR && location.pathname.startsWith('/selector/')) {
if (location.pathname.at(-1) === '/') {
location.pathname = '/guide/selector';
} else {
location.pathname = location.pathname.replace('/selector/', '/guide/');
if (!import.meta.env.SSR) {
if (location.pathname.startsWith('/selector/')) {
if (location.pathname.at(-1) === '/') {
location.pathname = '/guide/selector';
} else {
location.pathname = location.pathname.replace('/selector/', '/guide/');
}
} else if ((location.pathname = '/subscription/')) {
location.pathname = '/guide/subscription';
}
}