fix: correct login entry routing and errors

This commit is contained in:
hectorzhao
2026-07-08 18:03:30 +08:00
parent 8144f08652
commit a4a638208e
3 changed files with 44 additions and 3 deletions
+11
View File
@@ -6,6 +6,17 @@ import '@/styles/tokens.css';
import '@/styles/global.css';
import '@/styles/components.css';
function normalizeInitialHashRoute() {
if (window.location.hash) return;
const path = window.location.pathname;
if (path === '/admin' || path.startsWith('/admin/') || path === '/client' || path.startsWith('/client/')) {
window.history.replaceState(null, '', `/#${path}${window.location.search}`);
}
}
normalizeInitialHashRoute();
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<HashRouter>