feat: 관리자 페이지 추가 (공지사항, 다운로드, 유저 관리)

- /admin 라우트 추가 (admin 권한 전용)
- 공지사항 CRUD, 다운로드 정보 수정, 유저 권한/삭제 관리
- AuthContext에 role 추가 및 localStorage 저장
- 홈 헤더에 admin 링크 표시 (admin만 노출)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 14:52:28 +09:00
parent 9fa665c9c0
commit 1359c38222
11 changed files with 619 additions and 6 deletions

16
src/api/users.js Normal file
View File

@@ -0,0 +1,16 @@
import { apiFetch } from './client';
export function getUsers() {
return apiFetch('/api/users');
}
export function updateUserRole(id, role) {
return apiFetch(`/api/users/${id}/role`, {
method: 'PATCH',
body: JSON.stringify({ role }),
});
}
export function deleteUser(id) {
return apiFetch(`/api/users/${id}`, { method: 'DELETE' });
}