diff --git a/netlify.toml b/netlify.toml index 7987e42..950372c 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,18 +1,22 @@ [[redirects]] -from = "/api/850/*" - to = "https://8508958360.for-seoul.synctreengine.com" +from = "/api/904/*" + to = "https://9042753645.for-seoul.synctreengine.com/:splat" status = 200 force = true [[redirects]] -from = "/api/246/*" - to = "https://2468280591.for-seoul.synctreengine.com" +from = "/api/850/*" + to = "https://8508958360.for-seoul.synctreengine.com/:splat" status = 200 force = true - [[redirects]] -from = "/api/904/*" - to = "https://9042753645.for-seoul.synctreengine.com" +from = "/api/246/*" + to = "https://2468280591.for-seoul.synctreengine.com/:splat" status = 200 force = true + +[[redirects]] +from = "/*" +to = "/index.html" +status = 200 \ No newline at end of file diff --git a/public/_redirects b/public/_redirects deleted file mode 100644 index f824337..0000000 --- a/public/_redirects +++ /dev/null @@ -1 +0,0 @@ -/* /index.html 200 \ No newline at end of file diff --git a/src/App.jsx b/src/App.jsx index 0fde9cd..05fffd3 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -6,11 +6,12 @@ import Login from './pages/Login.jsx' import SignUp from './pages/Signup.jsx' import Layout from './Layout.jsx' import Detail from './pages/Detail.jsx' -import { useEffect, useState } from 'react' +import { useContext, useEffect, useState } from 'react' import AuthProvider from './provider/userProvider' import axios from 'axios' import CardHousing from './components/CardHousing.jsx' import Loading from './components/Loading.jsx' +import { AuthContext } from './provider/userContext' function App() { /* userCards는 유저의 카드, searchedCards는 유저가 카테고리를 클릭하거나, 검색을 했을 경우 화면에 보여지는 카드 */ @@ -20,6 +21,7 @@ function App() { const location = useLocation() const background = location.state && location.state.background const [loading, setLoading] = useState(false) + const user = useContext(AuthContext) // 서버에서 유저 카드 정보 가져오기 데모 코드 : 실제론 fetch 말고 axios 사용하는게 좋을 듯 // useEffect(() => { @@ -35,8 +37,10 @@ function App() { useEffect(() => { const fetchData = async () => { try { - const res = await axios.get('/api/904/insurance_list') - console.log(res) + const res = await axios.get('/api/904/insurance_list', { + headers: { 'Content-Type': 'application/json' }, + }) + console.log('보험정보', res) } catch (e) { console.log(e) } @@ -44,6 +48,21 @@ function App() { fetchData() }) + useEffect(() => { + const fetchUserData = async () => { + try { + const res = await axios.post('api/850/login_get_card', { + uid: 'receaGGFLSVcHUroH', + }) + console.log('유저카드정보', res) + } catch (e) { + console.log(e) + } + } + + fetchUserData() + }, [user]) + return (
{loading && }