|
|
@@ -140,6 +140,7 @@
|
|
|
callback(new Error('请填写正确的验证码'))
|
|
|
this.codeErrorChecked = false
|
|
|
this.codeChecked = false
|
|
|
+ console.log(this.codeChecked)
|
|
|
} else {
|
|
|
if (this.valid.code !== '') {
|
|
|
if (this.token) {
|
|
|
@@ -278,45 +279,50 @@
|
|
|
},
|
|
|
// 获取验证方式
|
|
|
getVerifyWay () {
|
|
|
- this.$http.get('/update/user/checkType').then(response => {
|
|
|
- if (response.data.success) {
|
|
|
- if (!response.data.content) {
|
|
|
- this.showManualAppeal = true
|
|
|
- } else {
|
|
|
- if (response.data.content.mobile) {
|
|
|
- this.hasValidPhoneWay = true
|
|
|
- this.showManualAppeal = true
|
|
|
- this.getMobile = response.data.content.mobile
|
|
|
- var reg = /^(\d{3})\d{6}(\d{2})$/
|
|
|
- this.secretMobile = this.getMobile.replace(reg, '$1******$2')
|
|
|
- }
|
|
|
- if (response.data.content.questions) {
|
|
|
- this.hasValidQuestionsWay = true
|
|
|
- this.showManualAppeal = true
|
|
|
- this.getQuestions = response.data.content.questions
|
|
|
- this.question1 = this.getQuestions[0].question || ''
|
|
|
- this.question2 = this.getQuestions[1].question || ''
|
|
|
- this.sort1 = this.getQuestions[0].sort || ''
|
|
|
- this.sort2 = this.getQuestions[1].sort || ''
|
|
|
- }
|
|
|
- if (response.data.content.email) {
|
|
|
- this.hasValidEmailWay = true
|
|
|
+ this.$http.get('/update/user/checkType')
|
|
|
+ .then(response => {
|
|
|
+ if (response.data.success) {
|
|
|
+ if (!response.data.content) {
|
|
|
this.showManualAppeal = true
|
|
|
- this.getEmail = response.data.content.email
|
|
|
- let getEmailIndex = this.getEmail.indexOf('@')
|
|
|
- if (getEmailIndex > 3) {
|
|
|
- let len = this.getEmail.substring(3, getEmailIndex)
|
|
|
- this.secretEmail = this.getEmail.replace(len, '*')
|
|
|
- } else {
|
|
|
- this.getEmailArr = this.getEmail.split('')
|
|
|
- this.getEmailSplit = this.getEmailArr.splice(getEmailIndex, 0, '*')
|
|
|
- this.secretEmail = this.getEmailArr.join('')
|
|
|
+ } else {
|
|
|
+ if (response.data.content.mobile) {
|
|
|
+ this.hasValidPhoneWay = true
|
|
|
+ this.showManualAppeal = true
|
|
|
+ this.getMobile = response.data.content.mobile
|
|
|
+ var reg = /^(\d{3})\d{6}(\d{2})$/
|
|
|
+ this.secretMobile = this.getMobile.replace(reg, '$1******$2')
|
|
|
+ }
|
|
|
+ if (response.data.content.questions) {
|
|
|
+ this.hasValidQuestionsWay = true
|
|
|
+ this.showManualAppeal = true
|
|
|
+ this.getQuestions = response.data.content.questions
|
|
|
+ this.question1 = this.getQuestions[0].question || ''
|
|
|
+ this.question2 = this.getQuestions[1].question || ''
|
|
|
+ this.sort1 = this.getQuestions[0].sort || ''
|
|
|
+ this.sort2 = this.getQuestions[1].sort || ''
|
|
|
+ }
|
|
|
+ if (response.data.content.email) {
|
|
|
+ this.hasValidEmailWay = true
|
|
|
+ this.showManualAppeal = true
|
|
|
+ this.getEmail = response.data.content.email
|
|
|
+ let getEmailIndex = this.getEmail.indexOf('@')
|
|
|
+ if (getEmailIndex > 3) {
|
|
|
+ let len = this.getEmail.substring(3, getEmailIndex)
|
|
|
+ this.secretEmail = this.getEmail.replace(len, '*')
|
|
|
+ } else {
|
|
|
+ this.getEmailArr = this.getEmail.split('')
|
|
|
+ this.getEmailSplit = this.getEmailArr.splice(getEmailIndex, 0, '*')
|
|
|
+ this.secretEmail = this.getEmailArr.join('')
|
|
|
+ }
|
|
|
}
|
|
|
+ this.goFirstStep = true
|
|
|
}
|
|
|
- this.goFirstStep = true
|
|
|
+ } else {
|
|
|
+ return Promise.reject(response.data)
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
+ }).catch(err => {
|
|
|
+ this.$message.error(err.errMsg)
|
|
|
+ })
|
|
|
},
|
|
|
// 选择方式
|
|
|
chooseWay (flag) {
|
|
|
@@ -346,21 +352,25 @@
|
|
|
this.$http.get(`/update/user/check/mobile`, {params: {mobile: this.getMobile}})
|
|
|
.then(response => {
|
|
|
this.isShowLoading = false
|
|
|
- this.token = response.data.content.token
|
|
|
- if (this.token !== '') {
|
|
|
- this.$message({
|
|
|
- message: '验证码已经发送到您的手机,请注意查收',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- this.sendAccountCode = false
|
|
|
- this.account_time = 60
|
|
|
- var accountTime = setInterval(() => {
|
|
|
- this.account_time--
|
|
|
- if (this.account_time <= 0) {
|
|
|
- this.sendAccountCode = true
|
|
|
- clearInterval(accountTime)
|
|
|
- }
|
|
|
- }, 1000)
|
|
|
+ if (response.data.success) {
|
|
|
+ this.token = response.data.content.token
|
|
|
+ if (this.token !== '') {
|
|
|
+ this.$message({
|
|
|
+ message: '验证码已经发送到您的手机,请注意查收',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.sendAccountCode = false
|
|
|
+ this.account_time = 60
|
|
|
+ var accountTime = setInterval(() => {
|
|
|
+ this.account_time--
|
|
|
+ if (this.account_time <= 0) {
|
|
|
+ this.sendAccountCode = true
|
|
|
+ clearInterval(accountTime)
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return Promise.reject(response.data)
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
this.isShowLoading = false
|
|
|
@@ -380,8 +390,8 @@
|
|
|
}
|
|
|
this.$http.post(`/update/user/check/mobile`, param, config)
|
|
|
.then(response => {
|
|
|
+ this.isShowLoading = false
|
|
|
if (response.data.success) {
|
|
|
- this.isShowLoading = false
|
|
|
this.$store.commit('login/GET_TOKEN', response.data.content)
|
|
|
this.showPhoneValid = false
|
|
|
this.$router.push({ path: '/validation/phoneValidationSecondStep' })
|
|
|
@@ -400,8 +410,8 @@
|
|
|
this.isShowLoading = true
|
|
|
this.$http.get(`/update/user/check/email`, {params: {email: this.getEmail, operate: 'mobile'}})
|
|
|
.then(response => {
|
|
|
+ this.isShowLoading = false
|
|
|
if (response.data.success) {
|
|
|
- this.isShowLoading = false
|
|
|
this.emailSendSuccess = true
|
|
|
} else {
|
|
|
this.emailSendSuccess = false
|
|
|
@@ -409,8 +419,8 @@
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
this.isShowLoading = false
|
|
|
- console.log(err)
|
|
|
-// this.$message.error(err.errMsg)
|
|
|
+ // console.log(err)
|
|
|
+ this.$message.error(err.errMsg)
|
|
|
})
|
|
|
},
|
|
|
// 第一步验证密保提交
|
|
|
@@ -427,8 +437,8 @@
|
|
|
}
|
|
|
this.$http.post(`/update/user/check/question`, param, config)
|
|
|
.then(response => {
|
|
|
+ this.isShowLoading = false
|
|
|
if (response.data.success) {
|
|
|
- this.isShowLoading = false
|
|
|
this.$store.commit('login/GET_TOKEN', response.data.content.token)
|
|
|
this.showQuestionsValid = false
|
|
|
this.$router.push({ path: '/validation/phoneValidationSecondStep' })
|