junh_eee(이준희)
8 months ago
12 changed files with 123 additions and 130 deletions
@ -1,46 +1,49 @@ |
|||||||
import { AxiosError } from 'axios'; |
import { AxiosError } from 'axios'; |
||||||
import { string } from 'prop-types'; |
|
||||||
import { ActionType, createAsyncAction } from 'typesafe-actions'; |
import { ActionType, createAsyncAction } from 'typesafe-actions'; |
||||||
|
|
||||||
|
// 아이디 찾기 인증번호 발송
|
||||||
const SEND_FORID_REQUEST = 'find/SEND_FORID_REQUEST'; |
const SEND_FORID_REQUEST = 'find/SEND_FORID_REQUEST'; |
||||||
const SEND_FORID_SUCCESS = 'find/SEND_FORID_SUCCESS'; |
const SEND_FORID_SUCCESS = 'find/SEND_FORID_SUCCESS'; |
||||||
const SEND_FORID_FAILURE = 'find/SEND_FORID_FAILURE'; |
const SEND_FORID_FAILURE = 'find/SEND_FORID_FAILURE'; |
||||||
|
|
||||||
|
// 아이디 찾기
|
||||||
const FIND_USERID_REQUEST = 'find/FIND_USERID_REQUEST'; |
const FIND_USERID_REQUEST = 'find/FIND_USERID_REQUEST'; |
||||||
const FIND_USERID_SUCCESS = 'find/FIND_USERID_SUCCESS'; |
const FIND_USERID_SUCCESS = 'find/FIND_USERID_SUCCESS'; |
||||||
const FIND_USERID_FAILURE = 'find/FIND_USERID_FAILURE'; |
const FIND_USERID_FAILURE = 'find/FIND_USERID_FAILURE'; |
||||||
|
|
||||||
|
// 비밀번호 찾기 인증번호 발송
|
||||||
const SEND_FORPW_REQUEST = 'find/SEND_FORPW_REQUEST'; |
const SEND_FORPW_REQUEST = 'find/SEND_FORPW_REQUEST'; |
||||||
const SEND_FORPW_SUCCESS = 'find/SEND_FORPW_SUCCESS'; |
const SEND_FORPW_SUCCESS = 'find/SEND_FORPW_SUCCESS'; |
||||||
const SEND_FORPW_FAILURE = 'find/SEND_FORPW_FAILURE'; |
const SEND_FORPW_FAILURE = 'find/SEND_FORPW_FAILURE'; |
||||||
|
|
||||||
const UPDATE_USERPW_REQUEST = 'find/UPDATE_USERPW_REQUEST' |
// 비밀번호 변경
|
||||||
const UPDATE_USERPW_SUCCESS = 'find/UPDATE_USERPW_SUCCESS' |
const UPDATE_USERPW_REQUEST = 'find/UPDATE_USERPW_REQUEST'; |
||||||
const UPDATE_USERPW_FAILURE = 'find/UPDATE_USERPW_FAILURE' |
const UPDATE_USERPW_SUCCESS = 'find/UPDATE_USERPW_SUCCESS'; |
||||||
|
const UPDATE_USERPW_FAILURE = 'find/UPDATE_USERPW_FAILURE'; |
||||||
|
|
||||||
export const sendForIdAction = createAsyncAction( |
export const sendForIdAction = createAsyncAction( |
||||||
SEND_FORID_REQUEST, |
SEND_FORID_REQUEST, |
||||||
SEND_FORID_SUCCESS, |
SEND_FORID_SUCCESS, |
||||||
SEND_FORID_FAILURE |
SEND_FORID_FAILURE |
||||||
)<{memberName: string, hpno: string}, string, AxiosError>(); |
)<{ memberName: string; hpno: string }, string, AxiosError>(); |
||||||
|
|
||||||
export const findUserIdAction = createAsyncAction( |
export const findUserIdAction = createAsyncAction( |
||||||
FIND_USERID_REQUEST, |
FIND_USERID_REQUEST, |
||||||
FIND_USERID_SUCCESS, |
FIND_USERID_SUCCESS, |
||||||
FIND_USERID_FAILURE |
FIND_USERID_FAILURE |
||||||
)<{memberName: string, hpno: string}, string, AxiosError>(); |
)<{ memberName: string; hpno: string }, string, AxiosError>(); |
||||||
|
|
||||||
export const sendForPwAction = createAsyncAction( |
export const sendForPwAction = createAsyncAction( |
||||||
SEND_FORPW_REQUEST, |
SEND_FORPW_REQUEST, |
||||||
SEND_FORPW_SUCCESS, |
SEND_FORPW_SUCCESS, |
||||||
SEND_FORPW_FAILURE |
SEND_FORPW_FAILURE |
||||||
)<{userId: string, hpno: string}, string, AxiosError>(); |
)<{ userId: string; hpno: string }, string, AxiosError>(); |
||||||
|
|
||||||
export const updatePwAction = createAsyncAction( |
export const updatePwAction = createAsyncAction( |
||||||
UPDATE_USERPW_REQUEST, |
UPDATE_USERPW_REQUEST, |
||||||
UPDATE_USERPW_SUCCESS, |
UPDATE_USERPW_SUCCESS, |
||||||
UPDATE_USERPW_FAILURE |
UPDATE_USERPW_FAILURE |
||||||
)<{userId: string, hpno: string, newPw: string}, string, AxiosError>(); |
)<{ userId: string; hpno: string; newPw: string }, string, AxiosError>(); |
||||||
|
|
||||||
const actions = { |
const actions = { |
||||||
sendForIdAction, |
sendForIdAction, |
@ -1,21 +0,0 @@ |
|||||||
import axios from '../../../utils/customAxiosUtil'; |
|
||||||
|
|
||||||
import qs from 'qs'; |
|
||||||
|
|
||||||
export const findAPI = { |
|
||||||
sendForId: async(param) => { |
|
||||||
return await axios.get(`api/acnt/crtfyhp/find/sendForId?memberName=${param.memberName}&hpno=${param.hpno}`); |
|
||||||
}, |
|
||||||
|
|
||||||
getUserId: async(param) => { |
|
||||||
return await axios.get(`api/acnt/crtfyhp/find/findUserId?memberName=${param.memberName}&hpno=${param.hpno}`); |
|
||||||
}, |
|
||||||
|
|
||||||
sendForPw: async(param) => { |
|
||||||
return await axios.get(`api/acnt/crtfyhp/find/sendForPw?userId=${param.userId}&hpno=${param.hpno}`); |
|
||||||
}, |
|
||||||
|
|
||||||
updatePw: async(param) => {
|
|
||||||
return await axios.get(`api/acnt/crtfyhp/find/updatePw?userId=${param.userId}&hpno=${param.hpno}&newPw=${param.newPw}`); |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,31 @@ |
|||||||
|
import axios from '../../../utils/customAxiosUtil'; |
||||||
|
|
||||||
|
export const findAPI = { |
||||||
|
// 아이디 찾기 인증번호 발송
|
||||||
|
sendForId: async param => { |
||||||
|
return await axios.get( |
||||||
|
`api/acnt/crtfyhp/find/sendForId?memberName=${param.memberName}&hpno=${param.hpno}` |
||||||
|
); |
||||||
|
}, |
||||||
|
|
||||||
|
// 아이디 찾기
|
||||||
|
getUserId: async param => { |
||||||
|
return await axios.get( |
||||||
|
`api/acnt/crtfyhp/find/findUserId?memberName=${param.memberName}&hpno=${param.hpno}` |
||||||
|
); |
||||||
|
}, |
||||||
|
|
||||||
|
// 비밀번호 찾기 인증번호 발송
|
||||||
|
sendForPw: async param => { |
||||||
|
return await axios.get( |
||||||
|
`api/acnt/crtfyhp/find/sendForPw?userId=${param.userId}&hpno=${param.hpno}` |
||||||
|
); |
||||||
|
}, |
||||||
|
|
||||||
|
// 비밀번호 변경
|
||||||
|
updatePw: async param => { |
||||||
|
return await axios.get( |
||||||
|
`api/acnt/crtfyhp/find/updatePw?userId=${param.userId}&hpno=${param.hpno}&newPw=${param.newPw}` |
||||||
|
); |
||||||
|
} |
||||||
|
}; |
@ -1,4 +1,4 @@ |
|||||||
export * from './actions/findAction'; |
export * from './actions'; |
||||||
export * from './models/findModel'; |
export * from './apis'; |
||||||
export * from './reducers/findReducer'; |
export * from './reducers'; |
||||||
export * from './sagas/findSaga'; |
export * from './sagas'; |
||||||
|
@ -1,19 +0,0 @@ |
|||||||
export interface AccountFindState { |
|
||||||
accountFind: AccountFindData | undefined; |
|
||||||
} |
|
||||||
export interface AccountFindData { |
|
||||||
cstmrSno: number; |
|
||||||
userId: string; |
|
||||||
memberName: string; |
|
||||||
hpno: string; |
|
||||||
cntfyhpNo: string; |
|
||||||
crtfyhpYn: string; |
|
||||||
} |
|
||||||
|
|
||||||
export interface IsCntfyhpSend { |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
export const initResponseFindData = { |
|
||||||
accountFind: undefined |
|
||||||
} |
|
@ -1,55 +0,0 @@ |
|||||||
// base
|
|
||||||
import produce from 'immer'; |
|
||||||
|
|
||||||
import { createReducer } from 'typesafe-actions'; |
|
||||||
|
|
||||||
// action
|
|
||||||
import { |
|
||||||
FindAction, |
|
||||||
findUserIdAction, |
|
||||||
sendForIdAction, |
|
||||||
sendForPwAction, |
|
||||||
updatePwAction |
|
||||||
} from '../actions/findAction'; |
|
||||||
|
|
||||||
//
|
|
||||||
export interface findState { |
|
||||||
idResult: string | undefined; |
|
||||||
userId: string | undefined; |
|
||||||
pwResult: string | undefined; |
|
||||||
udResult: string | undefined; |
|
||||||
} |
|
||||||
const initFindState : findState = { |
|
||||||
idResult: undefined, |
|
||||||
userId: undefined, |
|
||||||
pwResult: undefined, |
|
||||||
udResult: undefined |
|
||||||
} |
|
||||||
|
|
||||||
export const findAccountReducer = createReducer<findState, FindAction>( |
|
||||||
initFindState |
|
||||||
).handleAction(sendForIdAction.success, (state, action) =>
|
|
||||||
produce(state, draft => { |
|
||||||
const data = action.payload; |
|
||||||
|
|
||||||
draft.idResult = data; |
|
||||||
}) |
|
||||||
).handleAction(findUserIdAction.success, (state, action) =>
|
|
||||||
produce(state, draft => { |
|
||||||
const data = action.payload; |
|
||||||
|
|
||||||
draft.userId = data; |
|
||||||
}) |
|
||||||
).handleAction(sendForPwAction.success, (state, action) => |
|
||||||
produce(state, draft => { |
|
||||||
const data = action.payload; |
|
||||||
|
|
||||||
draft.pwResult = data; |
|
||||||
}) |
|
||||||
).handleAction(updatePwAction.success, (state, action) => |
|
||||||
produce(state, draft => { |
|
||||||
const data = action.payload; |
|
||||||
|
|
||||||
draft.udResult = data; |
|
||||||
}) |
|
||||||
) |
|
@ -0,0 +1,55 @@ |
|||||||
|
// base
|
||||||
|
import produce from 'immer'; |
||||||
|
|
||||||
|
import { createReducer } from 'typesafe-actions'; |
||||||
|
|
||||||
|
// action
|
||||||
|
import { |
||||||
|
FindAction, |
||||||
|
findUserIdAction, |
||||||
|
sendForIdAction, |
||||||
|
sendForPwAction, |
||||||
|
updatePwAction |
||||||
|
} from '../actions'; |
||||||
|
|
||||||
|
//
|
||||||
|
export interface findState { |
||||||
|
idResult: string | undefined; |
||||||
|
userId: string | undefined; |
||||||
|
pwResult: string | undefined; |
||||||
|
udResult: string | undefined; |
||||||
|
} |
||||||
|
const initFindState: findState = { |
||||||
|
idResult: undefined, |
||||||
|
userId: undefined, |
||||||
|
pwResult: undefined, |
||||||
|
udResult: undefined |
||||||
|
}; |
||||||
|
|
||||||
|
export const findAccountReducer = createReducer<findState, FindAction>( |
||||||
|
initFindState |
||||||
|
) |
||||||
|
.handleAction(sendForIdAction.success, (state, action) => |
||||||
|
produce(state, draft => { |
||||||
|
const data = action.payload; |
||||||
|
draft.idResult = data; |
||||||
|
}) |
||||||
|
) |
||||||
|
.handleAction(findUserIdAction.success, (state, action) => |
||||||
|
produce(state, draft => { |
||||||
|
const data = action.payload; |
||||||
|
draft.userId = data; |
||||||
|
}) |
||||||
|
) |
||||||
|
.handleAction(sendForPwAction.success, (state, action) => |
||||||
|
produce(state, draft => { |
||||||
|
const data = action.payload; |
||||||
|
draft.pwResult = data; |
||||||
|
}) |
||||||
|
) |
||||||
|
.handleAction(updatePwAction.success, (state, action) => |
||||||
|
produce(state, draft => { |
||||||
|
const data = action.payload; |
||||||
|
draft.udResult = data; |
||||||
|
}) |
||||||
|
); |
@ -1,4 +1,5 @@ |
|||||||
export * from './actions'; |
export * from './actions'; |
||||||
|
export * from './apis'; |
||||||
export * from './models'; |
export * from './models'; |
||||||
export * from './reducers'; |
export * from './reducers'; |
||||||
export * from './sagas'; |
export * from './sagas'; |
||||||
|
@ -1,4 +1,5 @@ |
|||||||
export * from './actions'; |
export * from './actions'; |
||||||
|
export * from './apis'; |
||||||
export * from './models'; |
export * from './models'; |
||||||
export * from './reducers'; |
export * from './reducers'; |
||||||
export * from './sagas'; |
export * from './sagas'; |
||||||
|
Loading…
Reference in new issue