From 08fa07dbedb193d7b3b0db7080f0f274cfa9baf6 Mon Sep 17 00:00:00 2001 From: sanguu Date: Fri, 23 Sep 2022 15:34:30 +0900 Subject: [PATCH] =?UTF-8?q?=ED=9A=8C=EC=9B=90=ED=83=88=ED=87=B4(=EB=AC=B8?= =?UTF-8?q?=EA=B5=AC=20=EB=9C=A8=EB=A9=B4=EC=84=9C=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EC=9D=B4=EB=8F=99)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/mypage/AccountMypageContainer.js | 1 - src/modules/account/login/sagas/authSaga.ts | 88 +++++-------------- 2 files changed, 20 insertions(+), 69 deletions(-) diff --git a/src/containers/account/mypage/AccountMypageContainer.js b/src/containers/account/mypage/AccountMypageContainer.js index 98e94b15..56c97e99 100644 --- a/src/containers/account/mypage/AccountMypageContainer.js +++ b/src/containers/account/mypage/AccountMypageContainer.js @@ -320,7 +320,6 @@ const AccountMypageContainer = () => { const waitwait = () => { dispatch(userDeleteAction.request(user.cstmrSno)); - // alert('아직 탈퇴 못해용~'); // setModal({ // isOpen: true, // title: '탈퇴 확인', diff --git a/src/modules/account/login/sagas/authSaga.ts b/src/modules/account/login/sagas/authSaga.ts index 606ba5da..19d14ddc 100644 --- a/src/modules/account/login/sagas/authSaga.ts +++ b/src/modules/account/login/sagas/authSaga.ts @@ -153,72 +153,28 @@ function* userPageSaga( function* userDeletePageSaga( action: ActionType ) { - // try { - // const controlId = action.payload; - - // const { data } = yield call(authAPI.deletedata, controlId); - // // console.log('userPageData : ', data) - // if (data.errorCode === '-1') { - // yield put( - // MessageActions.IS_ERROR({ - // errorCode: ERROR_MESSAGE.code, - // errorMessage: ERROR_MESSAGE.message, - // isHistoryBack: false, - // isRefresh: false - // }) - // ); - // yield put(Actions.userDeleteAction.success(data)); - // } else { - // yield put( - // MessageActions.IS_MESSAGE({ - // messageCode: SAVE_MESSAGE.code, - // message: SAVE_MESSAGE.message, - // isHistoryBack: false, - // isRefresh: false - // }) - // ); - // cookieStorage.removeCookie(COOKIE_ACCESS_TOKEN); - // cookieStorage.removeCookie(COOKIE_REFRESH_TOKEN); - - // yield put(replace('/')); - // } - // } catch (error) { - // yield put( - // MessageActions.IS_ERROR({ - // errorCode: ERROR_MESSAGE.code, - // errorMessage: '처리 중 에러입니다.', - // isHistoryBack: false, - // isRefresh: false - // }) - // ); - // } - // } - const accessToken = cookieStorage.getCookie(COOKIE_ACCESS_TOKEN); - //console.log('accessToken', accessToken); - try { - const controlId = action.payload; - // console.log('dddddddddddddddddddddddddddddddddddd'); - const { data } = yield call(authAPI.deletedata, controlId); + const controlId = action.payload; + // console.log('dddddddddddddddddddddddddddddddddddd'); + const { data } = yield call(authAPI.deletedata, controlId); + if (data.result === true) { + yield put( + MessageActions.IS_MESSAGE({ + messageCode: SAVE_MESSAGE.code, + message: SAVE_MESSAGE.message, + isHistoryBack: false, + isRefresh: true + }) + ); + //location.href = '/account/login'; + cookieStorage.removeCookie(COOKIE_ACCESS_TOKEN); + cookieStorage.removeCookie(COOKIE_REFRESH_TOKEN); - if (data.result === true) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: SAVE_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - location.href = '/account/login'; - // yield put(Actions.userDeleteAction.success(data));; - } - - // yield put(Actions.logout.success()); - cookieStorage.removeCookie(COOKIE_ACCESS_TOKEN); - cookieStorage.removeCookie(COOKIE_REFRESH_TOKEN); + yield put(replace('/')); + // yield put(Actions.userDeleteAction.success(data));; + } - yield put(replace('/')); + // yield put(Actions.logout.success()); } catch (error) { yield put(Actions.logout.failure(error)); } @@ -245,13 +201,9 @@ function* userUpdateSaga( messageCode: SAVE_MESSAGE.code, message: SAVE_MESSAGE.message, isHistoryBack: false, - isRefresh: true + isRefresh: false }) ); - cookieStorage.removeCookie(COOKIE_ACCESS_TOKEN); - cookieStorage.removeCookie(COOKIE_REFRESH_TOKEN); - - yield put(replace('/')); } } catch (error) { yield put(