统一前端的访问地址格式为/#/
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user