From a5d549dd88a6e8b0277c66348da761e569a17982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?sanguu516=28=EB=B0=95=EC=83=81=ED=98=84=29?= Date: Tue, 19 Sep 2023 17:24:27 +0900 Subject: [PATCH] =?UTF-8?q?authModel=20=EC=BB=AC=EB=9F=BC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/account/login/models/authModel.ts | 2 ++ src/modules/account/login/sagas/authSaga.ts | 8 ++++--- src/views/laanc/FlightPlan.js | 14 +++++++------ src/views/laanc/LeftMenu.js | 21 ++++++++++++++++++- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/modules/account/login/models/authModel.ts b/src/modules/account/login/models/authModel.ts index 42f85a4..5b9c15d 100644 --- a/src/modules/account/login/models/authModel.ts +++ b/src/modules/account/login/models/authModel.ts @@ -38,6 +38,8 @@ export interface LoginData { } export interface UserData { + email: string; + hpno: string; steCd: string; regDt: string; mdfcnDt: string; diff --git a/src/modules/account/login/sagas/authSaga.ts b/src/modules/account/login/sagas/authSaga.ts index 24dfc98..34f23d9 100644 --- a/src/modules/account/login/sagas/authSaga.ts +++ b/src/modules/account/login/sagas/authSaga.ts @@ -39,14 +39,17 @@ function* userLoginSaga(action: ActionType) { cookieStorage.setCookie(COOKIE_REFRESH_TOKEN, data.refreshToken); const user = yield call(authAPI.getUserProfile, data.cstmrSno); - // if (data.userId) { // cookieStorage.setCookie('SAVE_USR_ID', data.userId); // } else { // cookieStorage.removeCookie('SAVE_USR_ID'); // } - yield put(Actions.login.success({ ...user.data })); + yield put( + Actions.login.success({ + ...user.data + }) + ); } catch (error) { yield put(Actions.login.failure(error)); @@ -93,7 +96,6 @@ function* checkAuthencationSaga() { cookieStorage.setCookie(COOKIE_ACCESS_TOKEN, accessToken); // storageService.session.setItem(STORAGE_SESSION_ICT, user.icToken); - yield put( Actions.check.success({ isLogin: true, diff --git a/src/views/laanc/FlightPlan.js b/src/views/laanc/FlightPlan.js index 5df81ca..e3f2cac 100644 --- a/src/views/laanc/FlightPlan.js +++ b/src/views/laanc/FlightPlan.js @@ -3,7 +3,7 @@ import { Search } from 'react-feather'; import { BiBuildings, BiGridAlt } from 'react-icons/bi'; import { CgTrees } from 'react-icons/cg'; import { VscRadioTower } from 'react-icons/vsc'; -import { useDispatch, useSelector } from 'react-redux'; +import { useDispatch, useSelector, shallowEqual } from 'react-redux'; import Flatpickr from 'react-flatpickr'; import '@styles/react/libs/flatpickr/flatpickr.scss'; import { ErrorModal } from '../../components/modal/ErrorModal'; @@ -35,16 +35,16 @@ import { import { useHistory } from 'react-router-dom'; const FlightPlan = props => { const [detailData, setDetailData] = useState(initFlightBas.initDetail); + const user = useSelector(state => state.authState); const [modal2, setModal2] = useState({ isOpen: false, title: '', desc: '' }); - const history = useHistory(); + const handleChange = ({ name, value, type, index, pIndex }) => { // 입력 값에서 숫자 이외의 문자를 제거 - console.log('>>', name); const arrName = `${type}List`; @@ -90,8 +90,6 @@ const FlightPlan = props => { break; } }; - - console.log('>>>', detailData); const handlerNext = () => { const reg_email = /^([0-9a-zA-Z_\.-]+)@([0-9a-zA-Z_-]+)(\.[0-9a-zA-Z_-]+){1,2}$/; @@ -179,7 +177,11 @@ const FlightPlan = props => { }); return false; - } else handleClick(2); + } else { + //api 호출 부분 + + handleClick(2); + } }; const handleClick = value => { diff --git a/src/views/laanc/LeftMenu.js b/src/views/laanc/LeftMenu.js index 6425513..82bd411 100644 --- a/src/views/laanc/LeftMenu.js +++ b/src/views/laanc/LeftMenu.js @@ -4,13 +4,19 @@ import kac_logo from '../../assets/images/kac_logo_wh.png'; import FlightPlan from './FlightPlan'; import Apply from './Apply'; import { useState } from 'react'; - +import { AiOutlinePoweroff, AiOutlineExclamation } from 'react-icons/ai'; +import WebsocketClient from '../../components/websocket/WebsocketClient'; +import UserDropdown from '../../@core/layouts/components/navbar/UserDropdown'; function LeftMenu() { const [step, setStep] = useState(1); const handlerStep = step => { setStep(step); }; + + const handlerLogout = () => { + dispatch(Actions.logout.request()); + }; return ( <>
@@ -18,6 +24,19 @@ function LeftMenu() { PAL +
    +
      +
    • + +
    • +
    • + +
    • +