PJob-prisma/middleware/auth.ts

9 lines
216 B
TypeScript
Raw Permalink Normal View History

2024-04-12 10:23:44 +00:00
export default defineNuxtRouteMiddleware(async (to, from) => {
const auth = useCookie("auth");
if (auth.value == "brianling") {
} else {
alert("未登录");
return navigateTo("/login");
}
});