From cfbb660e54b70e8016a3f30a15de5b8574d81cdb Mon Sep 17 00:00:00 2001 From: jeasong Date: Thu, 6 May 2021 13:11:02 +0900 Subject: [PATCH] hoxfix token --- src/App.js | 3 +++ src/MainPages/components/Signin.js | 2 +- src/MyPages/MyPage.js | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 791b628..e1966db 100644 --- a/src/App.js +++ b/src/App.js @@ -74,6 +74,8 @@ export default function App() { //return this.setState({ email: message, createdAt: message }); } const { nickname, email, profile_image } = res.data.data.userInfo; + console.log(res.data.data.accessToken) + setAccessToken({accessToken:res.data.data.accessToken}) setUserInfo({ nickname: nickname, email: email, @@ -124,6 +126,7 @@ export default function App() { }; return (
+ { diff --git a/src/MyPages/MyPage.js b/src/MyPages/MyPage.js index 83d8283..0aa00fa 100644 --- a/src/MyPages/MyPage.js +++ b/src/MyPages/MyPage.js @@ -7,6 +7,7 @@ import Character1 from '../images/Character1.png'; import Character2 from '../images/Character2.png'; import Character3 from '../images/Character3.png'; import Character4 from '../images/Character4.png'; +import axios from 'axios'; function MyPage({ accessToken, isLogIn, loginCheck, userInfo }) { const PhotoData = [Character1, Character2, Character3, Character4]; @@ -58,6 +59,11 @@ function MyPage({ accessToken, isLogIn, loginCheck, userInfo }) { headers: { 'Content-Type': 'application/json' }, Credentials: 'include', }) + const SaveComment = await axios.post(`http://localhost:4000/mypage/${id}/comment`, + { + authorization: accessToken, + Comment: PhotoNum + }) }