• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript index.Actions.LoadingPage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中actions/index.Actions.LoadingPage的典型用法代码示例。如果您正苦于以下问题:TypeScript Actions.LoadingPage类的具体用法?TypeScript Actions.LoadingPage怎么用?TypeScript Actions.LoadingPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Actions.LoadingPage类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: GetApiTokens

function* GetApiTokens(action: any): SagaIterator {
  try {
    yield put(Actions.LoadingPage.onLoadingOn())
    yield put(Actions.NotificationBar.onResetNotificationBar())
    const { token } = action.payload
    const { apiToken } = yield call(CreateApiTokenFrost, token)
    yield put(Actions.ApiTokens.onCreateApiTokenSuccess(apiToken))
    yield put(
      Actions.NotificationBar.onShowNotificationBar({
        type: 'success',
        message: 'API TOKEN SUCCESSFULLY CREATED',
      })
    )
    yield put(Actions.LoadingPage.onLoadingFull())
    yield call(delay, 2000)
    yield put(Actions.NotificationBar.onHideNotificationBar())
    yield call(delay, 2000)
    yield put(Actions.NotificationBar.onResetNotificationBar())
  } catch (e) {
    yield put(Actions.ApiTokens.onCreateApiTokenError(e))
    yield put(Actions.LoadingPage.onLoadingFull())
    const errorMessage = typeof e === 'object' ? e.message : e
    toast.error(errorMessage, {
      className: 'toast',
      autoClose: 2500,
    })
  }
}
开发者ID:aconly,项目名称:frost-web,代码行数:28,代码来源:CreateApiToken.saga.ts


示例2: ChangePasswordToken

function* ChangePasswordToken(action: any): SagaIterator {
  try {
    const { token, password } = action.payload
    yield put(Actions.LoadingPage.onLoadingOn())

    const data = yield call(ChangePasswordTokenFrost, token, password)
    yield put(Actions.ChangePasswordToken.onChangePasswordTokenSuccess(data))

    yield put(Actions.LoadingPage.onLoadingFull())
    yield put(Actions.SignOut.onSignOut({ redirectLogin: false }))
    yield put(Actions.SetTokenLogin.onSetTokenLogin(data))

    yield call(delay, 1000)

    browserHistory.push('/dashboard')

    toast.success('Your password has been updated!', {
      className: 'toast',
      autoClose: 2500,
    })
  } catch (e) {
    yield put(Actions.LoadingPage.onLoadingFull())
    yield put(Actions.ChangePasswordToken.onChangePasswordTokenError(e))
    yield call(delay, 300)
    yield put(Actions.ChangePasswordToken.onChangePasswordTokenClearError())

    toast.error(e, {
      className: 'toast',
      autoClose: 2500,
    })
  }
}
开发者ID:aconly,项目名称:frost-web,代码行数:32,代码来源:ChangePasswordToken.saga.ts


示例3: VerifiedAccount

function* VerifiedAccount(action: any): SagaIterator {
  const toastId = toast.info('Verifying account...', {
    className: 'toast',
  })

  try {
    const { token, password } = action.payload
    yield put(Actions.LoadingPage.onLoadingOn())

    const data = yield call(GetApiTokensFrost, token, password)
    yield put(Actions.VerifiedAccount.onVerifiedAccountSuccess())

    yield put(Actions.LoadingPage.onLoadingFull())
    yield put(Actions.SignOut.onSignOut({ redirectLogin: false }))
    yield put(Actions.SetTokenLogin.onSetTokenLogin(data))

    yield call(delay, 1000)

    browserHistory.push('/dashboard')

    toast.success('Your account has been verified!', {
      className: 'toast',
      autoClose: 2500,
    })
  } catch (e) {
    yield put(Actions.LoadingPage.onLoadingFull())
    yield put(Actions.VerifiedAccount.onVerifiedAccountError(e))
    yield call(delay, 300)
    yield put(Actions.VerifiedAccount.onVerifiedAccountClearError())

    if (e.includes('Email already verified')) {
      browserHistory.push('/dashboard')
      toast.info(e, {
        className: 'toast',
        autoClose: 2500,
      })
    } else if (e.includes('Expired token')) {
      const message = 'This link has expired. Please login and request a new validation email.'
      toast.update(toastId, {
        render: message,
        type: toast.TYPE.ERROR,
        className: 'toast',
        autoClose: false,
      })
    } else
      toast.update(toastId, {
        render: e,
        type: toast.TYPE.ERROR,
        autoClose: false,
        className: 'toast',
      })
  }
}
开发者ID:aconly,项目名称:frost-web,代码行数:53,代码来源:VerifiedAccount.saga.ts


示例4: ForgotPassword

function* ForgotPassword(action: any): SagaIterator {
  try {
    const { email } = action.payload
    yield put(Actions.LoadingPage.onLoadingOn())
    yield call(GetApiTokensFrost, email)
    yield put(Actions.ForgotPassword.onForgotPasswordSuccess())
    yield put(Actions.LoadingPage.onLoadingFull())
    yield call(delay, 300)
  } catch (e) {
    yield put(Actions.LoadingPage.onLoadingFull())
    yield put(Actions.ForgotPassword.onForgotPasswordError(e))
  }
}
开发者ID:aconly,项目名称:frost-web,代码行数:13,代码来源:ForgotPassword.saga.ts


示例5: SignUp

function* SignUp(action: any): SagaIterator {
  try {
    const { email, password } = action.payload
    yield put(Actions.LoadingPage.onLoadingOn())
    const { token } = yield call(signUpFrost, { email, password })
    yield put(Actions.SignUp.onSignUpSuccess({ token, ...{ profile: { email } } }))
    yield put(Actions.Profile.onProfile({ token }))
    yield put(Actions.LoadingPage.onLoadingFull())
    yield call(delay, 300)
    browserHistory.push('/dashboard')
  } catch (e) {
    yield put(Actions.LoadingPage.onLoadingFull())
    yield put(Actions.SignUp.onSignUpError(e))
    yield call(delay, 300)
    yield put(Actions.SignUp.onSignUpClearError())
  }
}
开发者ID:aconly,项目名称:frost-web,代码行数:17,代码来源:SignUp.saga.ts


示例6: SendEmailVerifiedAccount

function* SendEmailVerifiedAccount(action: any): SagaIterator {
  try {
    const { token } = action.payload
    yield put(Actions.LoadingPage.onLoadingOn())
    yield call(SendEmailVerifiedAccountFrost, { token })
    yield put(Actions.SendEmailVerifiedAccount.onSendEmailVerifiedAccountSuccess())
    yield put(Actions.LoadingPage.onLoadingFull())
    yield call(delay, 1000 * 60)
    yield put(Actions.SendEmailVerifiedAccount.onSendEmailVerifiedAccountResetRetry())
  } catch (e) {
    yield put(Actions.LoadingPage.onLoadingFull())
    yield put(Actions.SendEmailVerifiedAccount.onSendEmailVerifiedAccountError(e))
    yield call(delay, 300)
    yield put(Actions.SendEmailVerifiedAccount.onSendEmailVerifiedAccountClearError())
    yield call(delay, 1000 * 60)
    yield put(Actions.SendEmailVerifiedAccount.onSendEmailVerifiedAccountResetRetry())
  }
}
开发者ID:aconly,项目名称:frost-web,代码行数:18,代码来源:SendEmailVerifiedAccount.saga.ts


示例7: DeleteApiToken

function* DeleteApiToken(action: any): SagaIterator {
  try {
    const { token, apiToken } = action.payload
    yield put(Actions.LoadingPage.onLoadingOn())
    yield call(DeleteApiTokenFrost, token, apiToken)
    yield put(Actions.DeleteApiToken.onDeleteApiTokenSuccess(apiToken))
    yield put(Actions.LoadingPage.onLoadingFull())
    yield put(Actions.Modal.onHideModal())
    yield call(delay, 300)
  } catch (e) {
    yield put(Actions.LoadingPage.onLoadingFull())
    yield put(Actions.DeleteApiToken.onDeleteApiTokenError(e))
    const errorMessage = typeof e === 'object' ? e.message : e
    toast.error(errorMessage, {
      className: 'toast',
      autoClose: 2500,
    })
  }
}
开发者ID:aconly,项目名称:frost-web,代码行数:19,代码来源:DeleteApiToken.saga.ts


示例8: SignIn

function* SignIn(action: any): SagaIterator {
  try {
    const { email, password } = action.payload
    yield put(Actions.LoadingPage.onLoadingOn())
    const { token } = yield call(signInFrost, { email, password })
    yield put(Actions.SignIn.onSignInSuccess({ token, ...{ profile: { email } } }))
    yield put(Actions.Profile.onProfile({ token }))
    yield put(Actions.LoadingPage.onLoadingFull())
    yield call(delay, 300)
    browserHistory.push('/dashboard')
  } catch (e) {
    yield put(Actions.LoadingPage.onLoadingFull())
    yield put(Actions.SignIn.onSignInError(e))
    yield call(delay, 300)
    yield put(Actions.SignIn.onSignInClearError())
    toast.error(e, {
      className: 'toast',
      autoClose: 2500,
    })
  }
}
开发者ID:aconly,项目名称:frost-web,代码行数:21,代码来源:SignIn.saga.ts



注:本文中的actions/index.Actions.LoadingPage类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript moduleBank.fetchModule函数代码示例发布时间:2022-05-28
下一篇:
TypeScript app.openNotification函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap