Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change pw #727

Merged
merged 4 commits into from
Sep 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading