Add frontend pages with login, download, and announcements
All checks were successful
Client CI/CD / deploy (push) Successful in 12s
All checks were successful
Client CI/CD / deploy (push) Successful in 12s
- React Router v7: public home page, /login page - Auth context with JWT localStorage management - Login: ID/PW form + SSAFY login button (UI only) - Home: hero banner, download section (login required), announcement board - API layer with mock data (ready for Go Fiber backend) - Color scheme: #2E2C2F dark + #BACDB0 accent - Add .env.example for environment variable reference Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
16
src/api/auth.js
Normal file
16
src/api/auth.js
Normal file
@@ -0,0 +1,16 @@
|
||||
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 }),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user