From 60e11ed55fdfb1876288cb35cb404af1a72b5ff4 Mon Sep 17 00:00:00 2001 From: munee <121735319+alaneelee@users.noreply.github.com> Date: Wed, 10 Jan 2024 21:50:13 +0900 Subject: [PATCH] =?UTF-8?q?URL=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modal/DonationModal.js | 4 ++-- src/modal/PaymentsModal.js | 17 ++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/modal/DonationModal.js b/src/modal/DonationModal.js index 2a81721..706acf3 100644 --- a/src/modal/DonationModal.js +++ b/src/modal/DonationModal.js @@ -110,7 +110,7 @@ const Donation = ({ closeModal, streamerId }) => { const fetchData = async () => { try { - const response = await axios.get('http://localhost:8081/api/point', { + const response = await axios.get(`${process.env.REACT_APP_API_URL}/api/point`, { headers: { Authorization: accessToken, }, @@ -139,7 +139,7 @@ const Donation = ({ closeModal, streamerId }) => { try { const response = await axios.post( - `http://localhost:8081/api/${streamerId}/donations`, + `${process.env.REACT_APP_API_URL}/api/${streamerId}/donations`, donationData, { headers: { diff --git a/src/modal/PaymentsModal.js b/src/modal/PaymentsModal.js index acf1352..766ae56 100644 --- a/src/modal/PaymentsModal.js +++ b/src/modal/PaymentsModal.js @@ -108,11 +108,14 @@ const PaymentsModal = ({ closeModal }) => { const fetchData = async () => { try { - const response = await axios.get('http://localhost:8081/api/point', { - headers: { - Authorization: accessToken, - }, - }); + const response = await axios.get( + `${process.env.REACT_APP_API_URL}/api/point`, + { + headers: { + Authorization: accessToken, + }, + } + ); setPointData(response.data); console.log('GET 요청 성공:', response.data); } catch (error) { @@ -123,7 +126,7 @@ const PaymentsModal = ({ closeModal }) => { const sendAmountToServer = async (amount) => { try { const response = await axios.post( - 'http://localhost:8081/api/point', + `${process.env.REACT_APP_API_URL}/api/point`, { point: amount, }, @@ -160,7 +163,7 @@ const PaymentsModal = ({ closeModal }) => { async (rsp) => { try { const { data } = await axios.post( - 'http://localhost:8081/verifyIamport/' + rsp.imp_uid + `${process.env.REACT_APP_API_URL}/verifyIamport/` + rsp.imp_uid ); if (rsp.paid_amount === data.response.amount) { alert('결제 성공');