feat: allow public monitor route without login and add monitor page

This commit is contained in:
zhi
2026-03-11 11:59:56 +00:00
parent d3562582b4
commit bc1714281c
4 changed files with 149 additions and 16 deletions

View File

@@ -22,7 +22,9 @@ api.interceptors.response.use(
(err) => {
if (err.response?.status === 401) {
localStorage.removeItem('token')
if (window.location.pathname !== '/login') {
const path = window.location.pathname
const publicPaths = ['/monitor', '/login']
if (!publicPaths.some((p) => path.startsWith(p))) {
window.location.href = '/login'
}
}