Commit c17f261e by zhanghaozhe

微信登录无痕验证

parent f1b49594
const UPDATE_CAPTCHA_STATE = 'UPDATE_CAPTCHA_STATE'
export const updateCaptchaState = payload => {
return {
type: UPDATE_CAPTCHA_STATE,
payload,
}
}
const SHOW_CAPTCHA_MODAL = 'SHOW_CAPTCHA_MODAL'
export const showCaptchaModal = () => {
return {
type: SHOW_CAPTCHA_MODAL,
}
}
const CLOSE_CAPTCHA_MODAL = 'CLOSE_CAPTCHA_MODAL'
export const closeCaptchaModal = () => {
return {
type: CLOSE_CAPTCHA_MODAL,
}
}
const VALIDATION_PASSED = 'VALIDATION_PASSED'
export const validationPassed = () => {
return {
type: VALIDATION_PASSED,
}
}
const initialState = {
isShowCaptcha: false,
isNeedValidation: false,
}
export default function noTraceValidation(state = initialState, action) {
switch (action.type) {
case UPDATE_CAPTCHA_STATE:
return {
...state,
...action.payload,
}
case SHOW_CAPTCHA_MODAL:
return {
...state,
...{isShowCaptcha: true},
}
case CLOSE_CAPTCHA_MODAL:
return {
...state,
...{isShowCaptcha: false},
}
case VALIDATION_PASSED:
return {
isNeedValidation: false,
isShowCaptcha: false,
}
default:
return state
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment