Upgrade verification code

This commit is contained in:
resonate
2022-01-14 13:23:41 +08:00
parent 0cd0c414ee
commit 2acc3cce67
4 changed files with 123 additions and 16 deletions
+2 -2
View File
@@ -49,10 +49,10 @@ def login_post():
return fail_api(msg="验证码错误")
user = User.query.filter_by(username=username).first()
if user is None:
if not user:
return fail_api(msg="不存在的用户")
if user.enable is 0:
if user.enable == 0:
return fail_api(msg="用户被暂停使用")
if username == user.username and user.validate_password(password):