Commit 7df6e77ec766039deb2d82a1dc63e448777148a5
1 parent
d36d4859
登陆验证码提交
Showing
1 changed file
with
11 additions
and
4 deletions
src/views/login/index.vue
| ... | ... | @@ -102,19 +102,26 @@ export default { |
| 102 | 102 | getVerifyCode(){ |
| 103 | 103 | let phone = this.loginForm.phone; |
| 104 | 104 | if (!this.loginForm.phone) { |
| 105 | - new Error('请输入手机号!'); | |
| 105 | + this.$message({ | |
| 106 | + type: 'error', | |
| 107 | + message: '请输入正确的手机号!' | |
| 108 | + }); | |
| 106 | 109 | } else if(!/^1[345678]\d{9}$/.test(this.loginForm.phone)) { |
| 107 | - new Error('请输入正确手机号!'); | |
| 110 | + this.$message({ | |
| 111 | + type: 'error', | |
| 112 | + message: '请输入正确的手机号!' | |
| 113 | + }); | |
| 108 | 114 | } |
| 109 | 115 | //获取验证码 |
| 110 | 116 | else { |
| 111 | 117 | sendValidatorCode(phone).then(response =>{ |
| 112 | - let data = response.data; | |
| 118 | + let data = response; | |
| 113 | 119 | if(data.code=='8888'){ |
| 114 | 120 | this.$message({ |
| 115 | 121 | type: 'success', |
| 116 | 122 | message: '验证码发送成功!' |
| 117 | 123 | }); |
| 124 | + this.validateBtn(); | |
| 118 | 125 | }else{ |
| 119 | 126 | this.$message({ |
| 120 | 127 | type: 'error', |
| ... | ... | @@ -122,7 +129,7 @@ export default { |
| 122 | 129 | }); |
| 123 | 130 | } |
| 124 | 131 | }); |
| 125 | - //this.validateBtn(); | |
| 132 | + | |
| 126 | 133 | |
| 127 | 134 | } |
| 128 | 135 | }, | ... | ... |