PJob-prisma/middleware/auth.ts
2024-04-12 18:23:44 +08:00

9 lines
216 B
TypeScript

export default defineNuxtRouteMiddleware(async (to, from) => {
const auth = useCookie("auth");
if (auth.value == "brianling") {
} else {
alert("未登录");
return navigateTo("/login");
}
});