-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from dnd-side-project/develop
✨ Update v0.3.0 - 소셜로그인 & 북마크
- Loading branch information
Showing
88 changed files
with
1,118 additions
and
775 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,46 @@ | ||
import axios, { AxiosError, InternalAxiosRequestConfig } from 'axios'; | ||
import axios from 'axios'; | ||
|
||
import { CustomInstance } from './type'; | ||
import { BASE_API_URL } from '@/constants/env'; | ||
import { getCookie } from '@/utils/cookieController'; | ||
|
||
import type { CustomInstance } from './type'; | ||
function getAccesstoken() { | ||
if (typeof window !== 'undefined') { | ||
const item = localStorage.getItem('accesstoken'); | ||
return item; | ||
} | ||
} | ||
|
||
const privateApi: CustomInstance = axios.create({ | ||
baseURL: `${BASE_API_URL}/api`, | ||
withCredentials: true, | ||
}); | ||
|
||
privateApi.interceptors.response.use( | ||
(response) => response.data, | ||
(error) => { | ||
if (error.response.status === 415) { | ||
alert('세션이 만료되었어요. 다시 로그인이 필요해요!'); | ||
} else { | ||
alert('오류가 발생했어요. 다시 시도해주세요'); | ||
} | ||
location.href = '/auth/logout'; | ||
return Promise.reject(error); | ||
} | ||
); | ||
|
||
privateApi.interceptors.request.use( | ||
async (config: InternalAxiosRequestConfig) => { | ||
try { | ||
const accessToken = getCookie('accessToken'); | ||
(config) => { | ||
const accessToken = getAccesstoken(); | ||
|
||
if (accessToken) { | ||
config.headers.Authorization = `Bearer ${accessToken}`; | ||
return config; | ||
} catch (error) { | ||
return Promise.reject(error); | ||
} | ||
|
||
return config; | ||
}, | ||
(error: AxiosError) => { | ||
Promise.reject(error); | ||
(error) => { | ||
console.log('request : ' + error.response); | ||
} | ||
); | ||
|
||
privateApi.interceptors.response.use((response) => response.data); | ||
|
||
export default privateApi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Link from 'next/link'; | ||
|
||
import { usePoseFeedQuery } from '@/apis'; | ||
import { PrimaryButton } from '@/components/Button'; | ||
import EmptyCase from '@/components/Feed/EmptyCase'; | ||
import FeedSection from '@/components/Feed/FeedSection'; | ||
import { URL } from '@/constants/url'; | ||
import useFilterState from '@/hooks/useFilterState'; | ||
|
||
export default function FeedContent() { | ||
const { filterState } = useFilterState(); | ||
const query = usePoseFeedQuery(filterState); | ||
|
||
return ( | ||
<FeedSection query={query}> | ||
<EmptyCase | ||
title={'신비한 포즈를 찾으시는군요!'} | ||
text={'찾고 싶은 포즈를 저희에게 알려주세요.'} | ||
> | ||
<Link href={URL.inquiry}> | ||
<PrimaryButton text={'문의사항 남기기'} /> | ||
</Link> | ||
</EmptyCase> | ||
</FeedSection> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
4 changes: 3 additions & 1 deletion
4
...pp/(Main)/feed/components/FilterSheet.tsx → src/app/(Main)/feed/FilterSheet.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.