统一前端的访问地址格式为/#/

This commit is contained in:
2026-07-27 10:21:35 +08:00
parent e3d4ec4624
commit d054908b30
4 changed files with 65 additions and 2 deletions

View File

@@ -11,6 +11,20 @@
</head>
<body>
<div id="app"></div>
<script>
;(function () {
var path = window.location.pathname
if (path !== '/' && path !== '') return
var hash = window.location.hash
if (!hash) {
window.location.replace(path + '#/admin/login')
return
}
if (hash.indexOf('#/') === 0 && (window.location.search === '?' || window.location.href.indexOf('/?#/') !== -1)) {
window.history.replaceState(null, '', path + hash)
}
})()
</script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>