Skip to content

Commit

Permalink
Merge pull request #85 from Plick-pop-in/feat/#5
Browse files Browse the repository at this point in the history
feat: user id 받아오기
  • Loading branch information
GimHaLim authored Jun 3, 2024
2 parents c38ffc3 + e13edad commit 08cd379
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 73 deletions.
69 changes: 0 additions & 69 deletions src/component/myPage/Signup.js
Original file line number Diff line number Diff line change
@@ -1,73 +1,4 @@
import './css/Signup.css';

// export default function Signup() {
// return (
// <div className="container">
// <div className="left-half">
// <div className="centered-image">
// <img src={require('../../assets/images/bigLogo.png')} alt='logo'/>
// <div className="title1">Welcome to Pop'in!</div>
// <div className="title2">팝업의 세계에 들어올 준비가 되셨냐요?</div>
// </div>
// </div>
// <div className="right-half">
// <div className="signupContainer">
// <div className="signupTitle">회원가입</div>
// <div className="signupDescription">pop`in의 회원이 되기 위해 정보를 입력해주세요.</div>
// <div className="signupLabel">이름</div>
// <input
// className="signupInput"
// name="name"
// type={'text'}
// placeholder="이름"
// />
// <div className="signupLabel">이메일</div>
// <div className="inputWithButton">
// <input
// className="emailInput"
// name="email"
// type={'text'}
// placeholder="이메일"
// />
// <button className="checkButton">중복 확인</button>
// </div>
// <div className="signupLabel">비밀번호</div>
// <input
// className="signupInput"
// name="pw"
// type={'password'}
// placeholder="비밀번호"
// />
// <div className="signupLabel">비밀번호 확인</div>
// <input
// className="signupInput"
// name="pwCheck"
// type={'password'}
// placeholder="비밀번호"
// />
// <div className="guideText">8자리 이상 입력해주세요.</div>
// <div className="signupLabel">닉네임</div>
// <div className="inputWithButton">
// <input
// className="nicknameInput"
// name="nickname"
// type={'text'}
// placeholder="닉네임"
// />
// <button className="checkButton">중복 확인</button>
// </div>
// <div>
// <button className="signupButton">회원가입</button>
// </div>
// <div className="loginPrompt">
// <div>이미 계정이 있으신가요? <a className="loginLink" href='./Login'>로그인</a></div>
// </div>
// </div>
// </div>
// </div>
// )
// }

import React, { useState } from "react";
import axios from "axios";
import useCustomLogin from './module/useCustomLogin';
Expand Down
17 changes: 17 additions & 0 deletions src/component/myPage/WishList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, { useEffect } from 'react';
import { useSelector } from 'react-redux';

export default function WishList() {
const loginInfo = useSelector(state => state.loginSlice);

useEffect(() => {
const userId = loginInfo.id;
console.log('User ID:', userId);
}, [loginInfo]);

return (
<div>
{/* 나머지 UI 구성 요소 */}
</div>
);
}
4 changes: 2 additions & 2 deletions src/component/myPage/api/kakaoApi.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from "axios";

const rest_api_key = '6f093e4c7a2e3031f6778b220ce263d7';
const redirect_uri = 'http://localhost:3000/KakaoRedirect';
const redirect_uri = 'http://d2vr7xh1eokzzb.cloudfront.net/KakaoRedirect';
const auth_code_path = 'https://kauth.kakao.com/oauth/authorize';
const access_token_url = 'https://kauth.kakao.com/oauth/token';

Expand Down Expand Up @@ -32,7 +32,7 @@ export const getAccessToken = async (authCode) => {

export const getMemberWithAccessToken = async (accessToken) => {
try {
const res = await axios.get(`http://localhost:8080/v1/user/kakao?accessToken=${accessToken}`);
const res = await axios.get(`http://www.plick.shop/v1/user/kakao?accessToken=${accessToken}`);
return res.data;
} catch (error) {
console.error('Error fetching member information:', error);
Expand Down
3 changes: 2 additions & 1 deletion src/component/myPage/api/userApi.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import axios from "axios";

const API_SERVER_HOST = 'http://www.plick.shop';
// const API_SERVER_HOST = 'http://www.plick.shop';
const API_SERVER_HOST = 'http://localhost:8080';

export const loginPost = async (loginParam) => {
const header = {headers: {"Content-Type": "application/x-www-form-urlencoded"}};
Expand Down
3 changes: 2 additions & 1 deletion src/component/myPage/slices/loginSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { loginPost } from "../api/userApi";
import { getCookie, removeCookie, setCookies } from "./cookieUtil";

const initState = {
email: ''
email: '',
id: ''
}

const loadMemberCookie = () => {
Expand Down

0 comments on commit 08cd379

Please sign in to comment.