Skip to content

Commit

Permalink
fix(mypage) header 부분 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-Dongwook committed Sep 24, 2023
1 parent 8b6afc6 commit 3d4de13
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions client/src/components/MyPage/MyPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -103,7 +101,6 @@ function MyPage() {
`http://localhost:8080/api/trip/search?page=${currentNumber}&sortType=${order}&keyWord=${keyword}`,
{
headers: {'Authorization': `Bearer ${token}`},
withCredentials: true,
}
);

Expand Down Expand Up @@ -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("태그가 변경되었습니다."));

Expand Down Expand Up @@ -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);
Expand All @@ -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 }) => {
Expand Down

0 comments on commit 3d4de13

Please sign in to comment.