From 86c6720f30208993ff2dc6a32bc5c4d7f6a79559 Mon Sep 17 00:00:00 2001 From: tolelom <98kimsungmin@naver.com> Date: Tue, 24 Feb 2026 14:32:02 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20mock=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0=20=EB=B0=8F=20=EC=8B=A4=EC=A0=9C=20API=20?= =?UTF-8?q?=EC=97=B0=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 모든 API 파일에서 mock 제거, 실제 백엔드 호출로 전환 - 공지사항 날짜 ISO 포맷에서 날짜만 표시하도록 수정 - VITE_API_BASE_URL을 https://a301.api.tolelom.xyz로 변경 (.env, gitignore) Co-Authored-By: Claude Sonnet 4.6 --- src/api/announcements.js | 34 ---------------------------- src/api/auth.js | 8 ------- src/api/download.js | 12 ---------- src/components/AnnouncementBoard.jsx | 2 +- 4 files changed, 1 insertion(+), 55 deletions(-) diff --git a/src/api/announcements.js b/src/api/announcements.js index 85ca033..6eae046 100644 --- a/src/api/announcements.js +++ b/src/api/announcements.js @@ -1,39 +1,5 @@ import { apiFetch } from './client'; -// TODO: 백엔드 연동 시 mock 제거 -const USE_MOCK = true; - -const MOCK_DATA = [ - { - id: 1, - title: '오픈 베타 테스트 안내', - content: '2월 28일부터 오픈 베타 테스트가 시작됩니다. 많은 참여 부탁드립니다.', - createdAt: '2026-02-24', - }, - { - id: 2, - title: '클라이언트 v0.2.0 업데이트', - content: '멀티플레이어 매칭 시스템이 개선되었습니다. 런처를 통해 업데이트해주세요.', - createdAt: '2026-02-20', - }, - { - id: 3, - title: '서버 점검 안내 (2/18)', - content: '2월 18일 02:00 ~ 06:00 서버 점검이 진행됩니다.', - createdAt: '2026-02-17', - }, - { - id: 4, - title: '테스터 모집 공고', - content: '신규 테스터를 모집합니다. 관심 있으신 분은 신청해주세요.', - createdAt: '2026-02-10', - }, -]; - export async function getAnnouncements() { - if (USE_MOCK) { - await new Promise((r) => setTimeout(r, 300)); - return MOCK_DATA; - } return apiFetch('/api/announcements'); } diff --git a/src/api/auth.js b/src/api/auth.js index 0276a96..0d1e612 100644 --- a/src/api/auth.js +++ b/src/api/auth.js @@ -1,14 +1,6 @@ import { apiFetch } from './client'; -// TODO: 백엔드 연동 시 mock 제거 -const USE_MOCK = true; - export async function login(username, password) { - if (USE_MOCK) { - await new Promise((r) => setTimeout(r, 500)); - if (!username || !password) throw new Error('아이디와 비밀번호를 입력해주세요.'); - return { token: 'mock-jwt-token', username }; - } return apiFetch('/api/auth/login', { method: 'POST', body: JSON.stringify({ username, password }), diff --git a/src/api/download.js b/src/api/download.js index 6fff175..700d494 100644 --- a/src/api/download.js +++ b/src/api/download.js @@ -1,17 +1,5 @@ import { apiFetch } from './client'; -// TODO: 백엔드 연동 시 mock 제거 -const USE_MOCK = true; - export async function getDownloadInfo() { - if (USE_MOCK) { - await new Promise((r) => setTimeout(r, 200)); - return { - url: '#', - version: 'v0.2.0', - fileSize: '1.2 GB', - fileName: 'A301_Launcher_Setup.exe', - }; - } return apiFetch('/api/download/info'); } diff --git a/src/components/AnnouncementBoard.jsx b/src/components/AnnouncementBoard.jsx index c56e1ab..d583327 100644 --- a/src/components/AnnouncementBoard.jsx +++ b/src/components/AnnouncementBoard.jsx @@ -21,7 +21,7 @@ export default function AnnouncementBoard() { onClick={() => setExpanded(expanded === item.id ? null : item.id)} > {item.title} - {item.createdAt} + {item.createdAt?.slice(0, 10)} {expanded === item.id && (
{item.content}