Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 최종 수정 #93

Open
wants to merge 1 commit into
base: Master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/hooks/useConfirmPayment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const confirmPayment = async ({
}

const response = await axios.post(
'https://order-together.duckdns.org/api/v1/payments/confirm',
'http://3.36.88.170:8080/api/v1/payments/confirm',
{ orderId, amount, paymentKey },
{
headers: {
Expand Down
2 changes: 1 addition & 1 deletion src/api/instance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const initInstance = (config: AxiosRequestConfig): AxiosInstance => {
return instance;
};

const BASE_URL = 'https://order-together.duckdns.org/api/v1';
const BASE_URL = 'http://3.36.88.170:8080/api/v1';

export const fetchInstance = initInstance({
baseURL: BASE_URL,
Expand Down
7 changes: 1 addition & 6 deletions src/components/OrderHistory/OrderListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,14 @@ const OrderListItem = ({
<Wrapper>
<Logo image={`/image/categories/${category.replaceAll(', ', ',')}.png`} />
<Container>
<div>
<img src="/image/ing.png" alt="진행중" />
<ProgressLabel>{deliveryStatus}</ProgressLabel>
</div>

<Title>
[{category}] {storeName}
</Title>
<span style={{ color: '#7E7E7E' }}>
주문 날짜: {date[0]}-{date[1]}-{date[2]} <br />
픽업장소: {pickUpLocation}
<br />
{price ? `결제금액: ${price}P` : ''}
{price && price !== -1 ? `결제금액: ${price}P` : ''}
</span>
</Container>
</Wrapper>
Expand Down
38 changes: 16 additions & 22 deletions src/components/common/MyPoint/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,13 @@ const MyPoint: React.FC<MyPointProps> = ({
const accessToken = Cookies.get('access_token');
if (!accessToken) return;

const response = await fetch(
'https://order-together.duckdns.org/api/v1/members',
{
method: 'GET',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${accessToken}`,
},
const response = await fetch('http://3.36.88.170:8080/api/v1/members', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${accessToken}`,
},
);
});

if (response.ok) {
const data = await response.json();
Expand Down Expand Up @@ -84,20 +81,17 @@ const MyPoint: React.FC<MyPointProps> = ({
}

try {
const response = await fetch(
'https://order-together.duckdns.org/api/v1/payments',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${accessToken}`,
},
body: JSON.stringify({
idempotencySeed: Math.random().toString(36).substr(2, 10),
productIds,
}),
const response = await fetch('http://3.36.88.170:8080/api/v1/payments', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${accessToken}`,
},
);
body: JSON.stringify({
idempotencySeed: Math.random().toString(36).substr(2, 10),
productIds,
}),
});

if (!response.ok) {
throw new Error('결제 정보 저장 실패');
Expand Down
1 change: 1 addition & 0 deletions src/components/mypage/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const Profile = ({ editMode, name, phoneNumber }: Props) => {
.then((response) => {
if (response.status === 200 && response.data) {
Cookies.remove('access_token');
sessionStorage.removeItem('codeProcessed');
setIsLoggedIn(false);
navigate(RouterPath.introduce);
}
Expand Down
6 changes: 2 additions & 4 deletions src/pages/LoginPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,9 @@ const LoginPage: React.FC = () => {
Authorization: `Bearer ${code}`,
'Content-Type': 'application/json',
},
maxRedirects: 0,
})
.then((response) => {
if (response.status === 302) {
window.location.href = response.data.redirectURL;
}
console.log('호출');
const accessToken = response.data.data.token;
if (accessToken) {
Cookies.set('access_token', accessToken);
Expand All @@ -57,6 +54,7 @@ const LoginPage: React.FC = () => {
}
})
.catch((error) => {
console.log('login: ', error);
if (error.response) {
if (error.response.status === 404) {
const redirectUrl = error.request.responseURL;
Expand Down
3 changes: 3 additions & 0 deletions src/pages/SignupPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ const SignupPage: React.FC = () => {
navigate(RouterPath.root);
navigate(0);
}
})
.catch((error) => {
console.log('signup:', error);
});
};

Expand Down