Skip to content

Commit

Permalink
修复登录不验证验证码的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
z-9527 committed Nov 30, 2018
1 parent c54d34b commit 445cec0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/routes/Login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ class LoginForm extends React.Component {
})
this.props.form.validateFields((err, values) => {
if (!err) {
// 表单登录时没有,需要手动验证,线上的没有修复
if(this.state.code.toUpperCase() !== values.verification.toUpperCase()){
this.props.form.setFields({
verification: {
value: values.verification,
errors: [new Error('验证码错误')]
}
})
return
}

const users = this.props.appStore.users
// 检测用户名是否存在
const result = users.find(item => item.username === values.username)
Expand Down

0 comments on commit 445cec0

Please sign in to comment.