Skip to content

Commit

Permalink
fix: Change BE endpoint (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
Queue-ri committed Oct 8, 2024
1 parent d137de7 commit b4d7d65
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/components/like/LikeButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import axios from 'axios';
import { changeUserInfo, reissueJWT } from '../../_actions/user_action';

function LikeButton(props) {
const SERVER = "eats-mate.com:8081"
const SERVER = "localhost:8081"
const userinfo = useSelector((state) => state.userReducer.userinfo)
const [clicked, setClicked] = useState(false);
const dispatch = useDispatch();
Expand Down
6 changes: 3 additions & 3 deletions src/components/login/LoginButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import styles from "./Login.module.css";
import { ReactComponent as KakaoLoginSvg } from "../../images/svg/kakao-login.svg";
import MobileKakaoLogin from "../../images/mobile_kakao_login.png"


const REST_API_KEY = "c4a648b170fea0fbd26e61d052e9093b";
const REDIRECT_URI = "https://eats-mate.com/user-service/auth/kakao";
const SERVER = "localhost:3000"; // FE
const REST_API_KEY = "b16b8c54e2c2b7fc607ed0c23abd4160";
const REDIRECT_URI = `http://${SERVER}/user-service/auth/kakao`;
const KAKAO_AUTH_URL = `https://kauth.kakao.com/oauth/authorize?client_id=${REST_API_KEY}&redirect_uri=${REDIRECT_URI}&response_type=code`;

function LoginButton() {
Expand Down
5 changes: 3 additions & 2 deletions src/components/login/LogoutButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ import { changeUserInfo } from '../../_actions/user_action';
import { useNavigate } from "react-router-dom";

function LogoutButton() {
const SERVER = "eats-mate.com:8081"
const PROTOCOL = "http"
const SERVER = "localhost:8081"
const dispatch = useDispatch();
const navigate = useNavigate();

async function handleLogout() {
if (window.confirm('정말 로그아웃 하시겠습니까?')) {
// logout
try{
const res = await axios.delete("https://" + SERVER + "/user-service/auth/logout",
const res = await axios.delete(PROTOCOL + "://" + SERVER + "/user-service/auth/logout",
{
withCredentials: true // Set-Cookie 작동을 위해 필수
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/ListCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ReactComponent as Exit } from '../../images/svg/exit_button.svg';
import axios from 'axios';

function ListCard(props) {
const SERVER = "eats-mate.com:8081"
const SERVER = "localhost:8081"
const [information, setInformation] = useState();
const [onClose, setOnClose] = useState(true);
const { searchInformation } = useContext(SearchContext);
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/MapCourse.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { changeUserInfo, reissueJWT } from '../../_actions/user_action';
import { CustomOverlayMap } from 'react-kakao-maps-sdk';

function MapCourse(props) {
const SERVER = "eats-mate.com:8081"
const SERVER = "localhost:8081"
const userinfo = useSelector((state) => state.userReducer.userinfo);
const [point, setPoint] = useState([]);
const [title, setTitle] = useState();
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/MapSearchBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import styles from './Map.module.css';
import { SearchContext } from '../../context/SearchContext';

const MapSearchBar = (props) => {
const SERVER = "eats-mate.com:8081"
const SERVER = "localhost:8081"
const [inputText, setInputText] = useState('');
const [selectValue, setSelectValue] = useState('전체');
const [information, setInformation] = useState([]); // data(restaurant, tour)
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/RestInformationCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import axios from 'axios';
import Review from '../mypage/Review';

function RestInformationCard(props) {
const SERVER = "eats-mate.com:8081"
const SERVER = "localhost:8081"
const navigate = useNavigate();
const [onClose, setOnClose] = useState(false);
const [information, setInformation] = useState({});
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/TabMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { SearchContext } from '../../context/SearchContext';
import { MarkerContext } from '../../context/MarkerContext';

function TabMenu(props) {
const SERVER = "eats-mate.com:8081"
const SERVER = "localhost:8081"
const [selectedTab, setSelectedTab] = useState();
const [tabData, setTabData] = useState([]);
const [data, setData] = useState();
Expand Down
2 changes: 1 addition & 1 deletion src/components/mypage/Like.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useSelector } from 'react-redux';
import { useNavigate } from "react-router-dom";

function Like(props) {
const SERVER = "eats-mate.com:8081"
const SERVER = "localhost:8081"
const userinfo = useSelector((state) => state.userReducer.userinfo)
const navigate = useNavigate();

Expand Down
2 changes: 1 addition & 1 deletion src/components/review/MainReview.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ReviewCounter from "./ReviewCounter";
import Review from "../mypage/Review";

function MainReview(props){
const SERVER = "eats-mate.com:8081"
const SERVER = "localhost:8081"
const placeName = useLocation().pathname.split("/").pop();
const navigate = useNavigate();
const [reviewList, setReviewList] = useState([]); // 리뷰 데이터 리스트
Expand Down
2 changes: 1 addition & 1 deletion src/components/review/RecentReview.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useMediaQuery } from "react-responsive"

function RecentReview(){
const navigate = useNavigate();
const SERVER = "eats-mate.com:8081"
const SERVER = "localhost:8081"
const [information, setInformation] = useState(undefined); // 백엔드에서 받아온 정보 객체 리스트
const [currentInfo, setCurrentInfo] = useState({}); // 버튼 클릭하면 나와야 하는 단일 정보 객체
const [btnClick, setBtnClick] = useState([]);
Expand Down
2 changes: 1 addition & 1 deletion src/components/review/ReviewModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ReactComponent as Rate1Svg } from "../../images/svg/rate-1.svg";
import { ReactComponent as Rate2Svg } from "../../images/svg/rate-2.svg";

function ReviewModal(props) {
const SERVER = "eats-mate.com:8081"
const SERVER = "localhost:8081"
const userinfo = useSelector((state) => state.userReducer.userinfo)
const dispatch = useDispatch();
const [imageList, setImageList] = useState([]);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MyPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import MobileNavBar from "../components/navigation/mobile/MobileNavBar";
import NoContent from '../components/etc/mobile/NoContent';

function MyPage() {
const SERVER = "eats-mate.com:8081"
const SERVER = "localhost:8081"
const dispatch = useDispatch();
const navigate = useNavigate();
const userinfo = useSelector((state) => state.userReducer.userinfo)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReviewPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import MobileNavBar from "../components/navigation/mobile/MobileNavBar";
import NoContent from '../components/etc/mobile/NoContent';

function ReviewPage() {
const SERVER = "eats-mate.com:8081"
const SERVER = "localhost:8081"
const navigate = useNavigate();
const dispatch = useDispatch();
const placeName = useLocation().pathname.split("/").pop();
Expand Down
2 changes: 1 addition & 1 deletion src/pages/StoreDetailPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import MobileNavBar from "../components/navigation/mobile/MobileNavBar";
import NoContent from '../components/etc/mobile/NoContent';

function StoreDetailPage(){
const SERVER = "eats-mate.com:8081"
const SERVER = "localhost:8081"
const userinfo = useSelector((state) => state.userReducer.userinfo)
const dispatch = useDispatch();
const navigate = useNavigate();
Expand Down

0 comments on commit b4d7d65

Please sign in to comment.