refactor: 관리자 콘솔을 별도 프로젝트(dognation_AT)로 분리 — PT에서 관리자 코드 제거
CI / build (push) Failing after 13m56s

- 관리자 페이지/스토어/API 삭제(adminAuth·adminMembers·adminStats·AdminLayout·pages/admin)
- 라우터에서 /admin 경로·관리자 가드 제거 (사용자 앱 라우팅만 유지)
- 공용 저수준(http put/del 등)은 dogs API 등이 사용하므로 유지

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
ByungCheol
2026-07-11 18:06:36 +09:00
parent 36f17be03a
commit 08743892d4
11 changed files with 0 additions and 1209 deletions
-52
View File
@@ -1,7 +1,6 @@
import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
import MainLayout from '@/layouts/MainLayout.vue'
import { useAuthStore } from '@/stores/auth'
import { useAdminAuthStore } from '@/stores/adminAuth'
const routes: RouteRecordRaw[] = [
{
@@ -18,35 +17,6 @@ const routes: RouteRecordRaw[] = [
{ path: 'profile', name: 'profile', component: () => import('@/pages/ProfilePage.vue') },
],
},
// 관리자 콘솔 (웹 전용) — 사용자 앱과 분리
{
path: '/admin/login',
name: 'admin-login',
component: () => import('@/pages/admin/AdminLoginPage.vue'),
},
{
path: '/admin',
component: () => import('@/layouts/AdminLayout.vue'),
meta: { requiresAdmin: true },
children: [
{ path: '', redirect: { name: 'admin-dashboard' } },
{
path: 'dashboard',
name: 'admin-dashboard',
component: () => import('@/pages/admin/AdminDashboardPage.vue'),
},
{
path: 'members',
name: 'admin-members',
component: () => import('@/pages/admin/AdminMembersPage.vue'),
},
{
path: 'members/:id',
name: 'admin-member-detail',
component: () => import('@/pages/admin/AdminMemberDetailPage.vue'),
},
],
},
]
const router = createRouter({
@@ -56,10 +26,6 @@ const router = createRouter({
// 소셜 로그인 전용 앱: 미로그인 시 보호 경로 접근 → 로그인으로
router.beforeEach((to) => {
// 관리자 경로는 아래 관리자 가드가 처리 (사용자 가드는 관여하지 않음)
if (to.matched.some((r) => r.meta.requiresAdmin) || to.name === 'admin-login') {
return true
}
const auth = useAuthStore()
if (to.meta.requiresAuth && !auth.isAuthenticated) {
return { name: 'login', query: { redirect: to.fullPath } }
@@ -69,22 +35,4 @@ router.beforeEach((to) => {
}
})
// 관리자 콘솔 가드 — 토큰/회원 복원 후 ADMIN 여부 확인 (사용자 인증과 분리)
router.beforeEach(async (to) => {
const needsAdmin = to.matched.some((r) => r.meta.requiresAdmin)
if (!needsAdmin && to.name !== 'admin-login') return true
const admin = useAdminAuthStore()
if (admin.hasToken() && !admin.member) {
await admin.fetchMe()
}
if (needsAdmin && !admin.isAdmin) {
return { name: 'admin-login' }
}
if (to.name === 'admin-login' && admin.isAdmin) {
return { name: 'admin-dashboard' }
}
return true
})
export default router