|
|
@@ -121,13 +121,18 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <loading v-show="isShowLoading"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import Loading from '~components/common/loading/Loading.vue'
|
|
|
export default {
|
|
|
name: 'validation',
|
|
|
+ components: {
|
|
|
+ Loading
|
|
|
+ },
|
|
|
data () {
|
|
|
// 第一步校验验证码
|
|
|
var validateFirstCode = (rule, value, callback) => {
|
|
|
@@ -137,7 +142,7 @@
|
|
|
this.codeChecked = false
|
|
|
} else {
|
|
|
if (this.valid.code !== '') {
|
|
|
- if (this.token !== '') {
|
|
|
+ if (this.token) {
|
|
|
if (this.valid.code !== '' && this.getMobile !== '') {
|
|
|
let param = new FormData()
|
|
|
param.append('mobile', this.getMobile)
|
|
|
@@ -160,7 +165,11 @@
|
|
|
this.codeErrorMsg = err.errMsg
|
|
|
})
|
|
|
}
|
|
|
- } else {}
|
|
|
+ } else {
|
|
|
+ callback(new Error('请先获取验证码'))
|
|
|
+ this.codeChecked = false
|
|
|
+ this.codeErrorChecked = false
|
|
|
+ }
|
|
|
}
|
|
|
callback()
|
|
|
}
|
|
|
@@ -189,6 +198,7 @@
|
|
|
}
|
|
|
}
|
|
|
return {
|
|
|
+ isShowLoading: false,
|
|
|
goFirstStep: true,
|
|
|
hasValidPhoneWay: false,
|
|
|
hasValidQuestionsWay: false,
|
|
|
@@ -270,6 +280,7 @@
|
|
|
getVerifyWay () {
|
|
|
this.$http.get('/sso/change/admin/checkType').then(response => {
|
|
|
if (response.data.success) {
|
|
|
+ // console.log(response.data)
|
|
|
if (!response.data.content) {
|
|
|
this.goFirstStep = true
|
|
|
this.showManualAppeal = true
|
|
|
@@ -334,8 +345,10 @@
|
|
|
},
|
|
|
// 获取第一步手机验证码
|
|
|
getCheckCode () {
|
|
|
+ this.isShowLoading = true
|
|
|
this.$http.get(`/sso/change/admin/check/mobile`)
|
|
|
.then(response => {
|
|
|
+ this.isShowLoading = false
|
|
|
this.token = response.data.content.token
|
|
|
if (this.token !== '') {
|
|
|
this.$message({
|
|
|
@@ -353,12 +366,14 @@
|
|
|
}, 1000)
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
+ this.isShowLoading = false
|
|
|
this.$message.error(err.errMsg)
|
|
|
})
|
|
|
},
|
|
|
// 手机号验证下一步
|
|
|
goNextStep () {
|
|
|
if (this.codeChecked) {
|
|
|
+ this.isShowLoading = true
|
|
|
let param = new FormData()
|
|
|
param.append('code', this.valid.code)
|
|
|
param.append('token', this.token)
|
|
|
@@ -368,6 +383,7 @@
|
|
|
this.$http.post(`/sso/change/admin/check/mobile`, param, config)
|
|
|
.then(response => {
|
|
|
if (response.data.success) {
|
|
|
+ this.isShowLoading = false
|
|
|
this.$store.commit('login/GET_TOKEN', response.data.content)
|
|
|
this.showPhoneValid = false
|
|
|
this.$router.push({ path: '/change/changeManagerSecondStep' })
|
|
|
@@ -376,21 +392,25 @@
|
|
|
return Promise.reject(response.data)
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
+ this.isShowLoading = false
|
|
|
this.$message.error(err.errMsg)
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
// 第一步验证邮箱
|
|
|
firstStepValidEmail () {
|
|
|
+ this.isShowLoading = true
|
|
|
this.$http.get(`/sso/change/admin/check/email`)
|
|
|
.then(response => {
|
|
|
if (response.data.success) {
|
|
|
+ this.isShowLoading = false
|
|
|
this.emailSendSuccess = true
|
|
|
} else {
|
|
|
this.emailSendSuccess = false
|
|
|
return Promise.reject(response.data)
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
+ this.isShowLoading = false
|
|
|
console.log(err)
|
|
|
// this.$message.error(err.errMsg)
|
|
|
})
|
|
|
@@ -398,6 +418,7 @@
|
|
|
// 第一步验证密保提交
|
|
|
validQuestionSubmit () {
|
|
|
if (this.answer1SecondChecked && this.answer2SecondChecked) {
|
|
|
+ this.isShowLoading = true
|
|
|
let param = new FormData()
|
|
|
let answer = []
|
|
|
answer.push({'answer': this.validQuestion.answer1, 'sort': this.sort1}, {'answer': this.validQuestion.answer2, 'sort': this.sort2})
|
|
|
@@ -409,6 +430,7 @@
|
|
|
this.$http.post(`/sso/change/admin/check/question`, param, config)
|
|
|
.then(response => {
|
|
|
if (response.data.success) {
|
|
|
+ this.isShowLoading = false
|
|
|
this.$store.commit('login/GET_TOKEN', response.data.content.token)
|
|
|
this.showQuestionsValid = false
|
|
|
this.$router.push({ path: '/change/changeManagerSecondStep' })
|
|
|
@@ -417,6 +439,7 @@
|
|
|
return Promise.reject(response.data)
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
+ this.isShowLoading = false
|
|
|
this.$message.error(err.errMsg)
|
|
|
})
|
|
|
}
|