stepEmail.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <div class="f-main">
  3. <div class="content-top">
  4. <p>密码重置</p>
  5. <a href="javascript:void(0)" class="back" @click="jump('select')"><i class="el-icon-back"></i></a>
  6. </div>
  7. <div class="f-form">
  8. <div class="page-part">
  9. <span>使用电子邮箱 <strong>183****08@qq.com</strong> 进行验证,有效期7天</span>
  10. </div>
  11. <div class="page-part">
  12. <mt-button :disabled="hasSend" size="large"
  13. type="primary"
  14. @click="sureAccount('select')"
  15. v-text="secretEmail">发送验证请求</mt-button>
  16. </div>
  17. </div>
  18. </div>
  19. </template>
  20. <script>
  21. export default {
  22. name: 'step-email',
  23. data () {
  24. return {
  25. secretEmail: '发送验证请求',
  26. hasSend: false
  27. }
  28. },
  29. methods: {
  30. jump (type) {
  31. this.$emit('stepEvent', type)
  32. },
  33. // 警告弹窗
  34. downToast (type) {
  35. this.$toast({
  36. message: type,
  37. iconClass: 'el-icon-warning'
  38. })
  39. },
  40. // 发送邮件
  41. sureAccount (type) {
  42. this.$indicator.open('发送过程中...')
  43. this.$http.get(`/sso/resetPwd/check/email`)
  44. .then(response => {
  45. this.$indicator.close()
  46. if (response.data.success) {
  47. this.$emit('stepEvent', type)
  48. this.hasSend = true
  49. this.secretEmail = '已发送验证邮件,请查收'
  50. } else {
  51. this.hasSend = false
  52. this.downToast(response.data.errMsg)
  53. }
  54. }).catch(() => {
  55. this.$indicator.close()
  56. this.downToast('请检查网络是否正常或联系服务商')
  57. })
  58. }
  59. }
  60. }
  61. </script>