feat: 评价页面搭建

This commit is contained in:
duanshuwen
2025-12-02 22:42:15 +08:00
parent 008f262470
commit f0097b84d1
14 changed files with 116 additions and 20 deletions

View File

@@ -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;
}