From e112d19e07e0e4f953446d6c44d437ba357c33c1 Mon Sep 17 00:00:00 2001 From: qkrxogmla Date: Sun, 11 May 2025 23:41:42 +0900 Subject: [PATCH 1/8] =?UTF-8?q?fetch=20=EC=A0=88=EB=8C=80=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/api/user.js b/frontend/src/api/user.js index 3964bac..749dc0a 100644 --- a/frontend/src/api/user.js +++ b/frontend/src/api/user.js @@ -1,5 +1,5 @@ export const loginUser = async ({ name, password }) => { - const res = await fetch("/api/login", { + const res = await fetch("http://www.pirocheck.org/login/login", { method: "POST", headers: { "Content-Type": "application/json", From 70c865e34b6435132717c5594649fad1ea999548 Mon Sep 17 00:00:00 2001 From: qkrxogmla Date: Sun, 11 May 2025 23:55:09 +0900 Subject: [PATCH 2/8] =?UTF-8?q?fetch=20usesr=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/Attendance.jsx | 4 ++-- frontend/src/api/user.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/Attendance.jsx b/frontend/src/Attendance.jsx index 1abe9db..66c2da3 100644 --- a/frontend/src/Attendance.jsx +++ b/frontend/src/Attendance.jsx @@ -3,7 +3,7 @@ import Header from "./components/Header"; import InputBlock from "./components/InputBlock"; import AttendanceWeekInfo from "./components/AttendanceWeekInfo"; import styles from "./Attendance.module.css"; -import axios from "axios"; +import api from "./api/api"; const Attendance = () => { const [attendanceCode, setAttendanceCode] = useState([""]); @@ -88,7 +88,7 @@ const Attendance = () => { if (!userId) return; // 유저 전체 출석 데이터 불러오기 - const res = await axios.get(`/api/attendance/user`, { + const res = await api.get(`/attendance/user`, { params: { userId }, withCredentials: true, // 세션 기반 인증 요청처리 }); diff --git a/frontend/src/api/user.js b/frontend/src/api/user.js index 749dc0a..f91670c 100644 --- a/frontend/src/api/user.js +++ b/frontend/src/api/user.js @@ -1,5 +1,5 @@ export const loginUser = async ({ name, password }) => { - const res = await fetch("http://www.pirocheck.org/login/login", { + const res = await fetch("http://www.pirocheck.org/api/login", { method: "POST", headers: { "Content-Type": "application/json", From 5c15ca1ce4624f4fc8c474bb7886ba35a5a544b5 Mon Sep 17 00:00:00 2001 From: qkrxogmla Date: Mon, 12 May 2025 00:07:36 +0900 Subject: [PATCH 3/8] =?UTF-8?q?=EC=84=B8=EC=85=98=EB=A7=8C=EB=A3=8C?= =?UTF-8?q?=EC=8B=9C=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/Assignment.jsx | 24 ++++++++++++------------ frontend/src/api/assignment.js | 6 ++---- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/frontend/src/Assignment.jsx b/frontend/src/Assignment.jsx index cff140f..f24604a 100644 --- a/frontend/src/Assignment.jsx +++ b/frontend/src/Assignment.jsx @@ -4,6 +4,7 @@ import Header from "./components/Header"; import AssignmentInfoBlock from "./components/AssignmentInfoBlock"; import styles from "./Assignment.module.css"; import { mapStatus } from "./utils/AssignmentStatus.js"; +import { fetchAssignmentsByUser } from "./api/assignment.js"; const Assignment = () => { const [weeks, setWeeks] = useState([]); @@ -16,18 +17,18 @@ const Assignment = () => { if (!userId) return; fetchAssignmentsByUser(userId) - .then((weekData) => { - const formatted = weekData.map((weekItem) => ({ - label: `${weekItem.week}주차 ${weekItem.title}`, - details: weekItem.days.map((dayItem) => ({ - day: dayItem.day, - subject: weekItem.title, - tasks: dayItem.details.map((task) => ({ - label: task.assignmentName, - status: mapStatus(task.status), + .then((weekData) => { + const formatted = weekData.map((weekItem) => ({ + label: `${weekItem.week}주차 ${weekItem.title}`, + details: weekItem.days.map((dayItem) => ({ + day: dayItem.day, + subject: weekItem.title, + tasks: dayItem.details.map((task) => ({ + label: task.assignmentName, + status: mapStatus(task.status), + })), })), - })), - })); + })); setWeeks(formatted); @@ -63,4 +64,3 @@ const Assignment = () => { }; export default Assignment; - diff --git a/frontend/src/api/assignment.js b/frontend/src/api/assignment.js index a576b62..cf1a11a 100644 --- a/frontend/src/api/assignment.js +++ b/frontend/src/api/assignment.js @@ -1,8 +1,6 @@ -import axios from "axios"; +import api from "./api"; export const fetchAssignmentsByUser = async (userId) => { - const res = await axios.get(`/api/assignment/grouped/${userId}`, { - withCredentials: true - }); + const res = await api.get(`/assignment/grouped/${userId}`); return res.data; }; From 64bad80a62ce1cfe4d2f7c2abd2d0205aa7abc89 Mon Sep 17 00:00:00 2001 From: qkrxogmla Date: Mon, 12 May 2025 00:08:59 +0900 Subject: [PATCH 4/8] base url http://www.pirocheck.org/api --- frontend/src/api/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/api/api.js b/frontend/src/api/api.js index 814c063..4ecf00d 100644 --- a/frontend/src/api/api.js +++ b/frontend/src/api/api.js @@ -1,7 +1,7 @@ import axios from "axios"; const api = axios.create({ - baseURL: "/api", + baseURL: "http://www.pirocheck.org/api", withCredentials: true, }); From c94f3855d4ed245727df03e72463f2f9ef6bbf91 Mon Sep 17 00:00:00 2001 From: qkrxogmla Date: Mon, 12 May 2025 00:29:28 +0900 Subject: [PATCH 5/8] =?UTF-8?q?attendance=20api=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/Attendance.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/Attendance.jsx b/frontend/src/Attendance.jsx index 66c2da3..45f8f6b 100644 --- a/frontend/src/Attendance.jsx +++ b/frontend/src/Attendance.jsx @@ -108,7 +108,7 @@ const Attendance = () => { if (!userId) return; const today = new Date().toISOString().split("T")[0]; // YYYY-MM-DD - const res = await axios.get(`/api/attendance/user/date`, { + const res = await api.get(`/attendance/user/date`, { params: { userId, date: today }, withCredentials: true, // 세션 기반 인증 요청처리 }); @@ -151,8 +151,8 @@ const Attendance = () => { if (!userId) return; // 유저가 입력한 출석 코드 서버에 전달(서버에서 출석코드 체크) - const res = await axios.post( - "/api/attendance/mark", + const res = await api.post( + "/attendance/mark", { userId, code: attendanceCode[0], From 55f7d5260407c8055dd898e88ff7253c22ddb6ec Mon Sep 17 00:00:00 2001 From: Suhjung Park <145967352+Imggaggu@users.noreply.github.com> Date: Mon, 12 May 2025 11:19:11 +0900 Subject: [PATCH 6/8] Update deploy.yml --- .github/workflows/deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2ef3e69..76e87ad 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -48,9 +48,9 @@ jobs: "fuser -k 8080/tcp || true && nohup java -jar pirocheck-0.0.1-SNAPSHOT.jar > log.txt 2>&1 &" - - name: Restart Spring Boot on EC2 - run: | - ssh -o StrictHostKeyChecking=no -i pirocheck.pem ubuntu@${{ secrets.EC2_HOST }} 'bash ~/restart.sh' + # - name: Restart Spring Boot on EC2 + # run: | + # ssh -o StrictHostKeyChecking=no -i pirocheck.pem ubuntu@${{ secrets.EC2_HOST }} 'bash ~/restart.sh' - name: Send Discord notification (Success) From c15dd048d081008151156bc136478a683f2ee120 Mon Sep 17 00:00:00 2001 From: Suhjung Park <145967352+Imggaggu@users.noreply.github.com> Date: Mon, 12 May 2025 12:12:33 +0900 Subject: [PATCH 7/8] Update deploy.yml --- .github/workflows/deploy.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 76e87ad..949c22b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -45,8 +45,9 @@ jobs: run: | ssh -o StrictHostKeyChecking=no -i pirocheck.pem \ ubuntu@${{ secrets.EC2_HOST }} \ - "fuser -k 8080/tcp || true && nohup java -jar pirocheck-0.0.1-SNAPSHOT.jar > log.txt 2>&1 &" - + "fuser -k 8080/tcp || true && \ + cd /home/ubuntu && \ + nohup java -jar pirocheck-0.0.1-SNAPSHOT.jar > log.txt 2>&1 &" # - name: Restart Spring Boot on EC2 # run: | From 7c562d906028f8504aa6aeaec501b6210479b023 Mon Sep 17 00:00:00 2001 From: Imggaggu Date: Mon, 12 May 2025 13:37:23 +0900 Subject: [PATCH 8/8] [Fix] baseurl for api --- frontend/src/api/api.js | 2 +- frontend/src/api/user.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/api/api.js b/frontend/src/api/api.js index 4ecf00d..8278d08 100644 --- a/frontend/src/api/api.js +++ b/frontend/src/api/api.js @@ -1,7 +1,7 @@ import axios from "axios"; const api = axios.create({ - baseURL: "http://www.pirocheck.org/api", + baseURL: "http://api.pirocheck.org/api", withCredentials: true, }); diff --git a/frontend/src/api/user.js b/frontend/src/api/user.js index f91670c..811264c 100644 --- a/frontend/src/api/user.js +++ b/frontend/src/api/user.js @@ -1,5 +1,5 @@ export const loginUser = async ({ name, password }) => { - const res = await fetch("http://www.pirocheck.org/api/login", { + const res = await fetch("http://api.pirocheck.org/api/login", { method: "POST", headers: { "Content-Type": "application/json",