From 3d4de13a46a9b56bcd57920a1cc6301be6add0fb Mon Sep 17 00:00:00 2001 From: Lee-Dongwook Date: Sun, 24 Sep 2023 21:09:21 +0900 Subject: [PATCH] =?UTF-8?q?fix(mypage)=20header=20=EB=B6=80=EB=B6=84=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/MyPage/MyPage.js | 33 +++++++++++++++++--------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/client/src/components/MyPage/MyPage.js b/client/src/components/MyPage/MyPage.js index 848901e9..df2a2f1d 100644 --- a/client/src/components/MyPage/MyPage.js +++ b/client/src/components/MyPage/MyPage.js @@ -62,7 +62,6 @@ function MyPage() { axios.get("http://localhost:8080/api/members/tripInfo", { headers:{'Authorization': `Bearer ${token}` }, - withCredentials: true }).then((response) => { setName(response.data.name); setGender(response.data.gender); @@ -79,7 +78,6 @@ function MyPage() { `http://localhost:8080/api/members/tripList?page=${currentNumber}&sortType=${order}`, { headers: {'Authorization': `Bearer ${token}`}, - withCredentials: true, } ); console.log(response.data); @@ -103,7 +101,6 @@ function MyPage() { `http://localhost:8080/api/trip/search?page=${currentNumber}&sortType=${order}&keyWord=${keyword}`, { headers: {'Authorization': `Bearer ${token}`}, - withCredentials: true, } ); @@ -236,10 +233,14 @@ function MyPage() { } else { var ranks = localStorage.getItem("rank"); console.log(ranks); + + const postToServer = { + types: rank + } + axios - .post("http://localhost:8080/api/members/change/types", { + .post("http://localhost:8080/api/members/change/types", postToServer, { headers: {'Authorization': `Bearer ${token}`}, - types: ranks, }) .then((res) => console.log(res), alert("태그가 변경되었습니다.")); @@ -335,10 +336,14 @@ function MyPage() { }; const handleCurrentPasswordButton = (e) => { + + const postToServer = { + pw: pw + } + axios - .post("http://localhost:8080/api/members/verify/pw", { + .post("http://localhost:8080/api/members/verify/pw", postToServer,{ headers: {'Authorization': `Bearer ${token}`}, - pw: pw, }) .then((res) => { console.log(res.data.result); @@ -352,11 +357,17 @@ function MyPage() { }; const handlePasswordButton = (e) => { + + const postToServer = { + pw: pw + } + axios - .post("http://localhost:8080/api/members/change/pw", { - pw: password, - },{ headers: {'Authorization': `Bearer ${token}`}}) - .then((res) => console.log(res), alert("비밀번호가 변경되었습니다.")); + .post("http://localhost:8080/api/members/change/pw", postToServer, + { + headers: {'Authorization': `Bearer ${token}`} + } + ).then((res) => console.log(res), alert("비밀번호가 변경되었습니다.")); }; const Posts = ({ posts, loading, handleClick }) => {