kpt

【user.py】修复了密码值返回的是函数的 Bug

@@ -21,7 +21,7 @@ def login(): @@ -21,7 +21,7 @@ def login():
21 hash_with_salt = hashlib.sha256('XiaoXueQi2024'.encode('utf-8')) 21 hash_with_salt = hashlib.sha256('XiaoXueQi2024'.encode('utf-8'))
22 hash_with_salt.update(request.form['password'].encode('utf-8')) 22 hash_with_salt.update(request.form['password'].encode('utf-8'))
23 return request.form[ 23 return request.form[
24 - 'username'] in user and hash_with_salt.hexdigest in user 24 + 'username'] in user and hash_with_salt.hexdigest() in user
25 25
26 users = query('select * from user', [], 'select') 26 users = query('select * from user', [], 'select')
27 login_success = list(filter(filter_fn, users)) 27 login_success = list(filter(filter_fn, users))