Skip to content

Commit 435662a

Browse files
committed
๐Ÿ›fix: main ํ•จ์ˆ˜ ํ† ํฐ ๋งŒ๋ฃŒ ์šฐํšŒ
1 parent 8192600 commit 435662a

3 files changed

Lines changed: 38 additions & 25 deletions

File tree

โ€Žsrc/api/client.tsxโ€Ž

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@ export const authClient = axios.create({
2727
},
2828
});
2929

30+
client.interceptors.request.use(
31+
(config) => {
32+
const accessToken = getAccessToken();
33+
if (accessToken && config.headers) {
34+
config.headers.Authorization = `Bearer ${accessToken}`;
35+
}
36+
return config;
37+
},
38+
(error) => {
39+
return Promise.reject(error);
40+
}
41+
);
42+
3043
authClient.interceptors.request.use(
3144
(config) => {
3245
const accessToken = getAccessToken();

โ€Žsrc/api/planet/space/space.tsxโ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { authClient } from "@/api/client";
1+
import client, { authClient } from "@/api/client";
22

33
// ๋ฉ”์ธ ์ŠคํŽ˜์ด์Šค ์•„์ด๋”” ์กฐํšŒ
44
export const getMainId = async () => {
5-
return await authClient.get(`/api/v1/spaces/main`);
5+
return await client.get(`/api/v1/spaces/main`);
66
};
77

88
// ์ „์ฒด ์ŠคํŽ˜์ด์Šค ๋ชฉ๋ก ์กฐํšŒ

โ€Žsrc/app/verify/letter/page.tsxโ€Ž

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -106,30 +106,30 @@ const VerifyLetter = () => {
106106
//accessToken์ด ์—†๋Š” ์ƒํ™ฉ์ด๋ผ๋ฉด ๋กœ๊ทธ์ธ์œผ๋กœ
107107

108108
//letterCode๊ฐ€ ์žˆ๋‹ค๋ฉด ๊ฒ€์ฆ ์ง„ํ–‰
109-
if (url) {
110-
verifyLetter(url)
111-
.then((res) => {
112-
if (res.data.letterId) {
113-
//๊ฒ€์ฆ ์„ฑ๊ณตํ•˜๋ฉด letterData๋ฅผ ๋ฐ›์•„์˜จ๋‹ค
114-
setletterId(res.data.letterId);
115-
fetchLetterData(res.data.letterId);
116-
}
117-
})
118-
.catch((error) => {
119-
//๊ฒ€์ฆ ์‹คํŒจ์‹œ ์กฐํšŒํ•  ์ˆ˜ ์—†๋Š” ํŽธ์ง€ ์—๋Ÿฌ ํŽ˜์ด์ง€๋กœ ์ด๋™
120-
console.log(error);
121-
router.push(url ? `/error/letter?url=${url}` : `/error/letter`);
122-
});
123-
}
109+
// if (url) {
110+
// verifyLetter(url)
111+
// .then((res) => {
112+
// if (res.data.letterId) {
113+
// //๊ฒ€์ฆ ์„ฑ๊ณตํ•˜๋ฉด letterData๋ฅผ ๋ฐ›์•„์˜จ๋‹ค
114+
// setletterId(res.data.letterId);
115+
// fetchLetterData(res.data.letterId);
116+
// }
117+
// })
118+
// .catch((error) => {
119+
// //๊ฒ€์ฆ ์‹คํŒจ์‹œ ์กฐํšŒํ•  ์ˆ˜ ์—†๋Š” ํŽธ์ง€ ์—๋Ÿฌ ํŽ˜์ด์ง€๋กœ ์ด๋™
120+
// console.log(error);
121+
// router.push(url ? `/error/letter?url=${url}` : `/error/letter`);
122+
// });
123+
// }
124124

125-
if (letterData === null) {
126-
//LetterData ๋ฐ›์•„์˜ค๋Š” ๋กœ์ง
127-
for (let i = 0; i < LETTER_DATA.length; i++) {
128-
if (LETTER_DATA[i].url === url) {
129-
setLetterData(LETTER_DATA[i]);
130-
}
131-
}
132-
}
125+
// if (letterData === null) {
126+
// //LetterData ๋ฐ›์•„์˜ค๋Š” ๋กœ์ง
127+
// for (let i = 0; i < LETTER_DATA.length; i++) {
128+
// if (LETTER_DATA[i].url === url) {
129+
// setLetterData(LETTER_DATA[i]);
130+
// }
131+
// }
132+
// }
133133
setIsLoading(false);
134134
}, []);
135135

0 commit comments

Comments
ย (0)