diff --git a/ajouthon/package.json b/ajouthon/package.json index 35493034..b533f436 100644 --- a/ajouthon/package.json +++ b/ajouthon/package.json @@ -58,5 +58,6 @@ "@types/react-csv": "^1.1.3", "@types/react-table": "^7.7.14", "@types/styled-components": "^5.1.26" - } + }, + "proxy": "https://sso.ajou.ac.kr" } diff --git a/ajouthon/src/Router.tsx b/ajouthon/src/Router.tsx index f8492d52..f1b02f52 100644 --- a/ajouthon/src/Router.tsx +++ b/ajouthon/src/Router.tsx @@ -12,13 +12,6 @@ import MemberSociety from "./pages/member/memberSociety/MemberSociety"; import RecordClub from "./pages/record/recordClub/RecordClub"; import RecordSociety from "./pages/record/recordSociety/RecordSociety"; -const TopContainer = styled.div` - display: flex; - width: 1440px; - height: 900px; - border: 1px solid black; -`; - const Router = () => { return ( @@ -57,3 +50,10 @@ const Router = () => { }; export default Router; + +const TopContainer = styled.div` + display: flex; + width: 1440px; + height: 900px; + border: 1px solid black; +`; diff --git a/ajouthon/src/components/header/Header.tsx b/ajouthon/src/components/header/Header.tsx index 87bcf3e5..3c79f479 100644 --- a/ajouthon/src/components/header/Header.tsx +++ b/ajouthon/src/components/header/Header.tsx @@ -8,50 +8,6 @@ import { accountAtom } from "../../atoms/accountAtom"; import { IAccount } from "../../interfaces/loginInterface"; import { TfiHelpAlt } from "react-icons/tfi"; -const HeaderContainer = styled.div` - display: flex; - justify-content: space-between; - border-bottom: 1px solid black; - padding: 10px 0; -`; - -const NavigationArea = styled.div` - display: flex; -`; - -const NavigationButton = styled.button` - display: flex; - justify-content: center; - padding: 13px 20px; - background-color: white; - color: #8c8c8c; - margin-right: 10px; - cursor: pointer; -`; - -const NavigationText = styled.span` - font-size: 18px; - margin-left: 5px; -`; - -const LogoutArea = styled.div` - display: flex; - justify-content: center; - align-items: center; - margin-right: 20px; - cursor: pointer; -`; - -const LogoutText = styled.span` - color: #8c8c8c; - margin-left: 5px; -`; - -const AjouLogo = styled.img` - width: 40px; - height: 40px; -`; - const Header = () => { const [account, setAccount] = useRecoilState(accountAtom); const navigate = useNavigate(); @@ -109,3 +65,47 @@ const Header = () => { }; export default Header; + +const HeaderContainer = styled.div` + display: flex; + justify-content: space-between; + border-bottom: 1px solid black; + padding: 10px 0; +`; + +const NavigationArea = styled.div` + display: flex; +`; + +const NavigationButton = styled.button` + display: flex; + justify-content: center; + padding: 13px 20px; + background-color: white; + color: #8c8c8c; + margin-right: 10px; + cursor: pointer; +`; + +const NavigationText = styled.span` + font-size: 18px; + margin-left: 5px; +`; + +const LogoutArea = styled.div` + display: flex; + justify-content: center; + align-items: center; + margin-right: 20px; + cursor: pointer; +`; + +const LogoutText = styled.span` + color: #8c8c8c; + margin-left: 5px; +`; + +const AjouLogo = styled.img` + width: 40px; + height: 40px; +`; diff --git a/ajouthon/src/pages/account/login/Login.tsx b/ajouthon/src/pages/account/login/Login.tsx index 6c57e3c3..4f4aff5f 100644 --- a/ajouthon/src/pages/account/login/Login.tsx +++ b/ajouthon/src/pages/account/login/Login.tsx @@ -3,77 +3,129 @@ import { useNavigate } from "react-router-dom"; import { useRecoilState } from "recoil"; import styled from "styled-components"; import { accountAtom } from "../../../atoms/accountAtom"; - -const LoginContainer = styled.div` - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - width: 1440px; - height: 900px; -`; - -const inputBoxStyle = { - color: "black", - border: "1px solid rgba(217, 217, 217, 1)", - marginTop: "10px", - marginBottom: "20px", - paddingLeft: "5px", - width: "50rem", - height: "2.5rem", -}; - -const buttonSytle = { - backgroundColor: "#1890FF", - color: "white", - borderRadius: "5px", - height: "2.5rem", - width: "5rem", - fontWeight: "bold", -}; - -const TextLogo = styled.img``; +import axios from "axios"; const Login = () => { const [id, setId] = useState(""); const [password, setPassword] = useState(""); + const [asmlRequest, setAsmlRequest] = useState(""); const [account, setAccount] = useRecoilState(accountAtom); const navigate = useNavigate(); + + async function loginPost(id: string, password: string) { + const response = await axios.post( + "/sso/processAuthnResponse.do", + { + autoLogin: "Y", + SAMLRequest: + "3A65828FF982B8FF0105D06ED6791B72782655586BFE69341E49E861FDB70B1C0652AD672B8419D0E855F11C1DE485DB0B778FB784B60D31BB212970AF0786B8D693543DB7790BB8C77C6D3EA1D3CDCAF71E19C00251B0540F5F0EB66D41F13E4A7E5666097E5183FFADE84A1898659AB7BC874C63594E5C75DCF47B32E92A6744F31B6536C4DDD532C84635A7405F6F93DB005B8BF320257ECE49AC8CCA34C463BDD8E66990A97C95898931310C6841037538D0607333C41F01FB8880223EE637ED54AD713CEBB163E302386CF48EE151200953A7AA1C5676E5A7ED6A1937F0B0A873E124D1930B812E6649FE9DD9E9FF8C1BFE78EE9B751DE0FFE37D95905D14A92297E301F5BE299E3B019A74747020F0D5C57837A80CA877130F656F786E", + RelayState: null, + returnPage: "/jsp/sso/ip/login_form.jsp", + userAgent: "PC|MACINTEL|CHROME|114", + relogin: "N", + userId: id, + password: password, + }, + { + headers: { + "Content-Type": "application/x-www-form-urlencoded", + Accept: + "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7", + }, + } + ); + // console.log(response.data); + // console.log(typeof response.data); + // DOMParser를 사용하여 HTML을 파싱 + const parser = new DOMParser(); + const doc = parser.parseFromString(response.data, "text/html"); + + const targetElement = doc.querySelector("input[name=SAMLResponse]"); + if (targetElement) { + const targetAttribute = targetElement.getAttribute("value"); + if (targetAttribute) { + setAsmlRequest(targetAttribute); + } + } + } + + const onSumbit = (e: React.FormEvent) => { + e.preventDefault(); + console.log(e); + loginPost(id, password); + }; + + console.log(asmlRequest); return ( -
-
학사서비스 ID
- setId(e.target.value)} - /> -
-
-
학사서비스 PW
- setPassword(e.target.value)} - /> -
-
{ - setAccount({ id: id, pw: password }); - navigate("/member-club"); - }} - > - -
+ + + 학사서비스 ID + setId(e.target.value)} + /> + + + 학사서비스 PW + setPassword(e.target.value)} + /> + + 로그인 +
); }; export default Login; + +const TextLogo = styled.img``; + +const LoginContainer = styled.div` + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + width: 1440px; + height: 900px; +`; + +const LoginForm = styled.form` + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +`; + +const LoginButton = styled.button` + background-color: #1890ff; + color: white; + border-radius: 5px; + height: 2.5rem; + width: 5rem; + font-weight: bold; +`; + +const InputBox = styled.div``; + +const InputTitle = styled.div``; + +const Input = styled.input` + color: black; + border: 1px solid rgba(217, 217, 217, 1); + margin-top: 10px; + margin-bottom: 20px; + padding-left: 5px; + width: 50rem; + height: 2.5rem; +`; +// "autoLogin=Y&SAMLRequest=3A65828FF982B8FF0105D06ED6791B72782655586BFE69341E49E861FDB70B1C0652AD672B8419D0E855F11C1DE485DB0B778FB784B60D31BB212970AF0786B8D693543DB7790BB8C77C6D3EA1D3CDCAF71E19C00251B0540F5F0EB66D41F13E4A7E5666097E5183FFADE84A1898659AB7BC874C63594E5C75DCF47B32E92A6744F31B6536C4DDD532C84635A7405F6F93DB005B8BF320257ECE49AC8CCA34C463BDD8E66990A97C95898931310C6841037538D0607333C41F01FB8880223EE637ED54AD713CEBB163E302386CF48EE151200953A7AA1C5676E5A7ED6A1937F0B0A873E124D1930B812E6649FE9DD9E9FF8C1BFE78EE9B751DE0FFE37D95905D14A92297E301F5BE299E3B019A74747020F0D5C57837A80CA877130F656F786E&returnPage=%2Fjsp%2Fsso%2Fip%2Flogin_form.jsp&userAgent=PC%7CMACINTEL%7CCHROME%7C114&relogin=N" diff --git a/ajouthon/src/pages/activity/activityClub/ActivityClub.tsx b/ajouthon/src/pages/activity/activityClub/ActivityClub.tsx index b2eb6bfb..ce8324c0 100644 --- a/ajouthon/src/pages/activity/activityClub/ActivityClub.tsx +++ b/ajouthon/src/pages/activity/activityClub/ActivityClub.tsx @@ -5,6 +5,35 @@ import styled from "styled-components"; import ClubTable from "../../../components/ClubTale"; import { ActivityModelColumn } from "../../../model/activityTableModel"; +const MemberClub = () => { + //동아리 회원 관리 페이지 + + return ( + + + + + + + + + + + + + + ); +}; + +export default MemberClub; + export const dummyData = [ { 활동명: "1", @@ -52,32 +81,3 @@ const buttonSytle = { width: "8rem", fontWeight: "bold", }; - -const MemberClub = () => { - //동아리 회원 관리 페이지 - - return ( - - - - - - - - - - - - - - ); -}; - -export default MemberClub; diff --git a/ajouthon/src/pages/activity/activitySociety/ActivitySociety.tsx b/ajouthon/src/pages/activity/activitySociety/ActivitySociety.tsx index 9d8c825c..710be95b 100644 --- a/ajouthon/src/pages/activity/activitySociety/ActivitySociety.tsx +++ b/ajouthon/src/pages/activity/activitySociety/ActivitySociety.tsx @@ -6,6 +6,33 @@ import ClubTable from "../../../components/ClubTale"; import { ActivityModelColumn } from "../../../model/activityTableModel"; import { Link } from "react-router-dom"; +const MemberClub = () => { + //동아리 회원 관리 페이지 + return ( + + + + + + + + + + + + + ); +}; + +export default MemberClub; + export const dummyData = [ { 활동명: "1", @@ -60,30 +87,3 @@ const buttonSytle = { width: "8rem", fontWeight: "bold", }; - -const MemberClub = () => { - //동아리 회원 관리 페이지 - return ( - - - - - - - - - - - - - ); -}; - -export default MemberClub; diff --git a/ajouthon/src/pages/help/Help.tsx b/ajouthon/src/pages/help/Help.tsx index 2b2ad95f..63a6cd61 100644 --- a/ajouthon/src/pages/help/Help.tsx +++ b/ajouthon/src/pages/help/Help.tsx @@ -72,6 +72,7 @@ const HelpCommand = styled.div` font-weight: bold; line-height: 25px; `; + const Help = () => { return ( diff --git a/ajouthon/src/pages/main/Main.tsx b/ajouthon/src/pages/main/Main.tsx index 26e4a497..997b7fbe 100644 --- a/ajouthon/src/pages/main/Main.tsx +++ b/ajouthon/src/pages/main/Main.tsx @@ -2,8 +2,6 @@ import React from "react"; import { Outlet } from "react-router-dom"; import { Container } from "../../components/container/Container"; import Header from "../../components/header/Header"; -import MenuBar from "../../components/menubar/MenuBar"; -import InfoBox from "../../components/infobox/InfoBox"; const Main = () => { return (