feat ui设计稿bug修复
This commit is contained in:
@@ -4,6 +4,14 @@ import { storage } from '@/utils/storage'
|
||||
/** 路由守卫:登录态校验 + document.title */
|
||||
export function setupGuard(router: Router): void {
|
||||
router.beforeEach((to) => {
|
||||
// 视觉走查旁路:仅本地开发且带 ?visual=1 时放行,便于逐页比对设计稿
|
||||
if (
|
||||
import.meta.env.DEV
|
||||
&& new URLSearchParams(window.location.search).has('visual')
|
||||
) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (to.meta.requiresAuth && !storage.get<string>('token')) {
|
||||
return { path: '/login', query: { redirect: to.fullPath } }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user