feat: 评价页面搭建
This commit is contained in:
@@ -36,15 +36,15 @@ const router = createRouter({
|
||||
routes,
|
||||
});
|
||||
|
||||
router.beforeEach((to, _from, next) => {
|
||||
router.beforeEach((to: any, from: any, next: any) => {
|
||||
const token = localStorage.getItem("token");
|
||||
if (to.meta && (to.meta as any).requiresAuth && !token) {
|
||||
next({ path: "/login" });
|
||||
return;
|
||||
}
|
||||
|
||||
if (token && to.path !== "/home") {
|
||||
next({ path: "/home" });
|
||||
if (token && to.path !== "/rate") {
|
||||
next({ path: "/rate" });
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user