From 7463c99215f8eac802048fc43f4c09eb6bc0639a Mon Sep 17 00:00:00 2001 From: nightbug-xx Date: Mon, 9 Jun 2025 18:39:45 +0900 Subject: [PATCH 1/7] Remove duplicate signup route --- src/App.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index fa6ee64..bca0305 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -41,7 +41,6 @@ function App() { } /> } /> } /> - } /> } /> } /> } /> From bf26a295be12405be48a6dcd6a29811e6c78804b Mon Sep 17 00:00:00 2001 From: nightbug-xx Date: Mon, 9 Jun 2025 18:40:06 +0900 Subject: [PATCH 2/7] fix: use combat_power field on edit --- src/pages/CharacterEditPage.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/CharacterEditPage.tsx b/src/pages/CharacterEditPage.tsx index 793c2ce..8986223 100644 --- a/src/pages/CharacterEditPage.tsx +++ b/src/pages/CharacterEditPage.tsx @@ -37,11 +37,11 @@ export default function CharacterEditPage() { const handleUpdate = async () => { try { - await api.put(`/characters/${id}`, { - name, - server, - power: Number(combatPower) - }) + await api.put(`/characters/${id}`, { + name, + server, + combat_power: Number(combatPower) + }) navigate('/characters') } catch { setError('캐릭터 수정에 실패했습니다.') From 908196cacdd79b002a94dd8b82da86e4ff484684 Mon Sep 17 00:00:00 2001 From: nightbug-xx Date: Mon, 9 Jun 2025 18:40:39 +0900 Subject: [PATCH 3/7] Add route for my homeworks --- src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index fa6ee64..900e2bd 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -39,7 +39,7 @@ function App() { } /> } /> } /> - } /> + } /> } /> } /> } /> From 0d52ef187a827cb4317d612ad4e70ebee0cb8a6b Mon Sep 17 00:00:00 2001 From: nightbug-xx Date: Mon, 9 Jun 2025 18:41:11 +0900 Subject: [PATCH 4/7] feat: load API base URL from env --- .env.example | 5 +++++ src/lib/api.ts | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..90bf525 --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +# Rename this file to .env and set the API base URL for your environment +# Example: +# VITE_API_BASE_URL=http://localhost:8000 +VITE_API_BASE_URL=https://api.example.com + diff --git a/src/lib/api.ts b/src/lib/api.ts index 9c788fe..2271829 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -1,8 +1,7 @@ import axios from 'axios' const api = axios.create({ - baseURL: 'https://api.biryu2000.kr', - // baseURL: 'http://localhost:8000', + baseURL: import.meta.env.VITE_API_BASE_URL, }) // 요청 시 토큰 자동 추가 From d2efeee720debaacf5825ce574f2e7a0d2fbbc42 Mon Sep 17 00:00:00 2001 From: nightbug-xx Date: Mon, 9 Jun 2025 18:41:32 +0900 Subject: [PATCH 5/7] Remove unused token_type logic --- src/lib/api.ts | 1 - src/pages/Login.tsx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/api.ts b/src/lib/api.ts index 9c788fe..e514ea0 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -24,7 +24,6 @@ api.interceptors.response.use( if (error.response?.status === 401) { // 로그아웃 처리 localStorage.removeItem('access_token') - localStorage.removeItem('token_type') // 리로드 또는 리다이렉트 window.location.href = '/login' } diff --git a/src/pages/Login.tsx b/src/pages/Login.tsx index 0dab2b4..ef118db 100644 --- a/src/pages/Login.tsx +++ b/src/pages/Login.tsx @@ -20,7 +20,7 @@ export default function Login() { password, }) - const { access_token, token_type } = res.data + const { access_token } = res.data console.log('로그인 성공:', access_token) login(access_token) // ✅ 전역 상태 + localStorage 동시 반영 From eb8de2b6977163cec1b2de863482932cd7899b04 Mon Sep 17 00:00:00 2001 From: nightbug-xx Date: Mon, 9 Jun 2025 18:42:20 +0900 Subject: [PATCH 6/7] =?UTF-8?q?=EB=B6=88=ED=95=84=EC=9A=94=ED=95=9C=20inde?= =?UTF-8?q?x.css=20=EC=A0=9C=EA=B1=B0=20=EB=B0=8F=20main.tsx=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.css | 0 src/main.tsx | 1 - 2 files changed, 1 deletion(-) delete mode 100644 src/index.css diff --git a/src/index.css b/src/index.css deleted file mode 100644 index e69de29..0000000 diff --git a/src/main.tsx b/src/main.tsx index 872fb68..298801e 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,6 +1,5 @@ import { StrictMode } from 'react' import { createRoot } from 'react-dom/client' -import './index.css' import App from './App.tsx' // ✅ 추가: AuthProvider import From 91f5a32dbe4f5e83bff0b5e87db738de5455ef4a Mon Sep 17 00:00:00 2001 From: nightbug-xx Date: Mon, 9 Jun 2025 18:51:14 +0900 Subject: [PATCH 7/7] Add friend menu with submenus --- src/App.tsx | 4 ++++ src/components/Layout.tsx | 11 +++++++++++ src/pages/FriendList.tsx | 12 ++++++++++++ src/pages/FriendRequests.tsx | 12 ++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 src/pages/FriendList.tsx create mode 100644 src/pages/FriendRequests.tsx diff --git a/src/App.tsx b/src/App.tsx index 8228a3b..6a90d01 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -16,6 +16,8 @@ import Dashboard from './pages/Dashboard' import MePage from './pages/MePage' import CharacterEditPage from './pages/CharacterEditPage' import GuidePage from './pages/Guide' +import FriendList from './pages/FriendList' +import FriendRequests from './pages/FriendRequests' const darkTheme = createTheme({ palette: { @@ -44,6 +46,8 @@ function App() { } /> } /> } /> + } /> + } /> } /> diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index f49a838..a9e89a1 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -19,6 +19,7 @@ export default function Layout({ children }: { children: React.ReactNode }) { const [anchorElCharacter, setAnchorElCharacter] = useState(null) const [anchorElHomework, setAnchorElHomework] = useState(null) + const [anchorElFriend, setAnchorElFriend] = useState(null) const [anchorElUser, setAnchorElUser] = useState(null) const handleMenuOpen = ( @@ -71,6 +72,16 @@ export default function Layout({ children }: { children: React.ReactNode }) { 숙제 목록 + + + 친구목록 + 요청관리 + + diff --git a/src/pages/FriendList.tsx b/src/pages/FriendList.tsx new file mode 100644 index 0000000..c3c9bab --- /dev/null +++ b/src/pages/FriendList.tsx @@ -0,0 +1,12 @@ +import { Box, Typography } from '@mui/material' + +export default function FriendList() { + return ( + + + 친구 목록 + + 준비 중... + + ) +} diff --git a/src/pages/FriendRequests.tsx b/src/pages/FriendRequests.tsx new file mode 100644 index 0000000..53de455 --- /dev/null +++ b/src/pages/FriendRequests.tsx @@ -0,0 +1,12 @@ +import { Box, Typography } from '@mui/material' + +export default function FriendRequests() { + return ( + + + 요청 관리 + + 준비 중... + + ) +}