Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions src/axios/TokenInterceptor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from 'axios';
import {LOCAL_SPRING_API_URL} from "../constants/api";
import { SPRING_API_URL } from "../constants/api";

const instance = axios.create();

Expand Down Expand Up @@ -49,7 +49,7 @@ instance.interceptors.response.use(async function (response) {
}
if (data.message === "유효하지 않은 토큰") {
try {
const tokenReissueResult = await instance.post(`${LOCAL_SPRING_API_URL}/reissue`);
const tokenReissueResult = await instance.post(`${ SPRING_API_URL}/reissue`);
if (tokenReissueResult.status === 200) {
// 재발급 성공시 로컬스토리지에 토큰 저장
const accessToken = tokenReissueResult.headers['authorization'] || tokenReissueResult.headers['Authorization'];
Expand All @@ -73,7 +73,7 @@ instance.interceptors.response.use(async function (response) {
export const Logout = async () => {
try {
const token = localStorage.getItem('accessToken');
await axios.post(`${LOCAL_SPRING_API_URL}/logout`, null, {
await axios.post(`${ SPRING_API_URL}/logout`, null, {
headers: {
Authorization: `Bearer ${token}`
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/oauth/KakaoRedirectPage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useRef } from "react";
import { useLocation, useNavigate } from "react-router-dom";
import instance from "../../axios/TokenInterceptor";
import { LOCAL_SPRING_API_URL } from "../../constants/api";
import { SPRING_API_URL } from "../constants/api";

const KakaoRedirectPage = () => {
const location = useLocation();
Expand All @@ -12,7 +12,7 @@ const KakaoRedirectPage = () => {
const handleOAuthKakao = async (code) => {
try {
const response = await instance.get(
`${LOCAL_SPRING_API_URL}/oauth/login/kakao?code=${code}`
`${ SPRING_API_URL}/oauth/login/kakao?code=${code}`
);

if (response.data.isSuccess) {
Expand Down
5 changes: 4 additions & 1 deletion src/constants/api.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
export const LOCAL_SPRING_API_URL = "http://localhost:8080/api/spring";
export const LOCAL_FASTAPI_API_URL = "http://localhost:8000/api/fastapi";
export const LOCAL_FASTAPI_API_URL = "http://localhost:8000/api/fastapi";

export const SPRING_API_URL = "https://www.humanicare.store/api/spring";
export const FASTAPI_API_URL = "https://www.humanicare.store/api/fastapi";
54 changes: 54 additions & 0 deletions src/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/* 기본 설정 */
* {
box-sizing: border-box;
}

body {
margin: 0;
padding: 0;
background-color: var(--bg-color);
font-family: "Noto Sans KR", sans-serif;
}

/* CSS 변수 정의 */
:root {
--bg-color: #f8ead2;
--accent-color: #dabec9;
--font-dark: #1c2c5b;
--font-light: #999;
--btn-radius: 12px;
}

/* 버튼 스타일 */
.button-basic {
padding: 12px 24px;
border: 1px solid #333;
background-color: white;
border-radius: var(--btn-radius);
font-size: 16px;
cursor: pointer;
}

.button-accent {
background-color: var(--accent-color);
color: white;
border: none;
}

/* 센터 정렬 */
.flex-center {
display: flex;
justify-content: center;
align-items: center;
}

/* 카드/박스 */
.card {
background-color: white;
border: 1px solid #ccc;
border-radius: var(--btn-radius);
padding: 20px;
box-shadow: 2px 2px 6px rgba(0,0,0,0.1);
}


1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import './global.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

Expand Down
6 changes: 3 additions & 3 deletions src/pages/KeywordSelectionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "react-time-picker/dist/TimePicker.css";
import "react-clock/dist/Clock.css";
import Logo from "../components/Logo";
import axios from "axios";
import { LOCAL_SPRING_API_URL } from "../constants/api";
import { SPRING_API_URL } from "../constants/api";
import { getAccessToken } from "../components/Header";

const keywords = {
Expand Down Expand Up @@ -119,7 +119,7 @@ const KeywordSelectionPage = () => {

try {
const response = await axios.get(
`${LOCAL_SPRING_API_URL}/all-basic-schedules`,
`${SPRING_API_URL}/all-basic-schedules`,
{
headers: { Authorization: `Bearer ${token}` },
}
Expand Down Expand Up @@ -202,7 +202,7 @@ const KeywordSelectionPage = () => {

try {
const response = await axios.post(
`${LOCAL_SPRING_API_URL}/basic-schedules`,
`${ SPRING_API_URL}/basic-schedules`,
payload,
{
headers: {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/LoginPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React from "react";
import { useNavigate } from "react-router-dom";
import Button from "../components/Button";
import Logo from "../components/Logo";
import { LOCAL_SPRING_API_URL } from "../constants/api";
import { SPRING_API_URL } from "../constants/api";

const LoginPage = () => {
const navigate = useNavigate();
const handleKakaoLogin = () => {
window.location.href = `${LOCAL_SPRING_API_URL}/oauth/kakao`;
window.location.href = `${ SPRING_API_URL}/oauth/kakao`;
};

return (
Expand Down