fixed: 手机号登录验证码校验,及其后端逻辑校验逻辑修改

This commit is contained in:
冷冷 2018-03-02 13:35:54 +08:00
parent 07848a6058
commit fbb4bd32c1

View File

@ -158,6 +158,7 @@
this.loading = true
if (!this.loginForm.smsCode || this.loginForm.smsCode.length !== 4) {
this.$message.error('验证码不合法')
return false
}
this.$store.dispatch('MobileLogin', this.loginForm).then(() => {
this.loading = false
@ -176,11 +177,12 @@
url: '/admin/smsCode/' + this.loginForm.mobile,
method: 'get'
}).then(response => {
if (response.data) {
console.log(response)
if (response.data.data) {
this.timer()
this.$message.success('验证码发送成功')
} else {
this.$message.error('验证码发送失败')
this.$message.error(response.data.msg)
}
})
}