From 259e9ef4b74286a1784014ae782519c2c12e589e Mon Sep 17 00:00:00 2001 From: aranlll <163715414+aranlll@users.noreply.github.com> Date: Sat, 18 May 2024 21:52:00 +0900 Subject: [PATCH] [feature]/#6/login MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 서버에서 데이터 받아오기 하려고 햇으나 ... 실패.... --- client/green__day/package-lock.json | 29 ++++++++++++++++++++++ client/green__day/package.json | 1 + client/green__day/src/App.js | 38 +++++++++-------------------- client/green__day/src/Home.js | 18 ++++++++++---- client/green__day/src/xlog.js | 0 5 files changed, 55 insertions(+), 31 deletions(-) create mode 100644 client/green__day/src/xlog.js diff --git a/client/green__day/package-lock.json b/client/green__day/package-lock.json index b8eb113d..f71b148d 100644 --- a/client/green__day/package-lock.json +++ b/client/green__day/package-lock.json @@ -11,6 +11,7 @@ "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "axios": "^1.6.8", "react": "^18.3.1", "react-dom": "^18.3.1", "react-router-dom": "^6.23.1", @@ -5398,6 +5399,29 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", + "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axios/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/axobject-query": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", @@ -14746,6 +14770,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", diff --git a/client/green__day/package.json b/client/green__day/package.json index 02d51e1e..ff1caedc 100644 --- a/client/green__day/package.json +++ b/client/green__day/package.json @@ -6,6 +6,7 @@ "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "axios": "^1.6.8", "react": "^18.3.1", "react-dom": "^18.3.1", "react-router-dom": "^6.23.1", diff --git a/client/green__day/src/App.js b/client/green__day/src/App.js index e9fb8e08..e6363c9f 100644 --- a/client/green__day/src/App.js +++ b/client/green__day/src/App.js @@ -7,11 +7,12 @@ import Notice from "./Notice.js"; import History from "./History.js"; -import { useState } from "react"; +import { useState ,useEffect} from "react"; function App() { let [buttonOpen,setButtonOpen]=useState(false); + /*let [shouldRenderApp,setShouldRenderApp]=useState(true);*/ const [isModalOpen, setModalOpen] = useState(false);//useState사용하여 상태 초기화 및 모달의 열림/닫힘 상태관리 @@ -40,14 +41,18 @@ function App() { // console.error('데이터를 가져오는 중 오류 발생:', error); // } // } - + /* useEffect(() => { + const path = window.location.pathname; + const excludedPaths = ['/History', '/Notice',"/Home"]; // 제외할 경로들 + setShouldRenderApp(!excludedPaths.includes(path)); + }, []); + + if (!shouldRenderApp) { + return null; + }; + */ return ( <> -