feat: thêm ít avatar

This commit is contained in:
ngthanhvu
2026-07-23 11:00:05 -04:00
parent 629d5d7d2d
commit 70d8fc5bfa
62 changed files with 1401 additions and 158 deletions
+11
View File
@@ -0,0 +1,11 @@
export default defineNuxtRouteMiddleware(async (to) => {
if (to.path !== '/thanh-vien') return
const { data: user, error } = await useFetch('/api/auth/me', {
headers: useRequestHeaders(['cookie']),
})
if (error.value?.statusCode === 401 || !user.value) {
return navigateTo('/')
}
})