Skip to content

Commit

Permalink
修复登录接口
Browse files Browse the repository at this point in the history
  • Loading branch information
liwanlei committed Apr 15, 2020
1 parent 0643c36 commit 79090ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/home/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def post(self):
session['username'] = username
return jsonify({'msg': login_user_sucess_message, 'code': 200, 'data': ''})
else:
if (user.err_num >= 5):
if (user.err_num!= None and user.err_num >= 5 ):
if (user.freetime != 'None'):
if (datetime.datetime.now() - user.freetime).minute > 10:
user.err_num = user_err_num + 1
Expand All @@ -135,12 +135,17 @@ def post(self):
db.session.commit()
return jsonify({'msg': login_user_fremm, 'code': 36, 'data': ''})
else:
user.err_num = user_err_num + 1
if user.err_num==None:
user.err_num=0
else:user.err_num = user_err_num + 1
db.session.add(user)
db.session.commit()
return jsonify({'msg': login_password_error_message, 'code': 36, 'data': ''})
else:
user.err_num = user_err_num + 1
if user.err_num == None:
user.err_num = 0
else:
user.err_num = user_err_num + 1
db.session.add(user)
db.session.commit()
return jsonify({'msg': login_password_error_message, 'code': 36, 'data': ''})
Expand Down
Binary file modified data.sqlite
Binary file not shown.

0 comments on commit 79090ab

Please sign in to comment.