관리자 기능과 태그 표시 설정 추가

This commit is contained in:
2026-05-01 18:00:22 +09:00
parent 237eb2990f
commit 787747aa7f
51 changed files with 2261 additions and 128 deletions

View File

@@ -0,0 +1,17 @@
/**
* 관리자 페이지 접근 인증
* @param {import('#app').RouteLocationNormalized} to - 이동 대상 라우트
* @returns {Promise<ReturnType<typeof navigateTo> | void>} 라우트 이동 결과
*/
export default defineNuxtRouteMiddleware(async (to) => {
if (!to.path.startsWith('/admin') || to.path.startsWith('/admin/api') || to.path === '/admin/login') {
return
}
try {
const requestFetch = import.meta.server ? useRequestFetch() : $fetch
await requestFetch('/admin/api/auth/me')
} catch {
return navigateTo('/admin/login')
}
})