From 718b98ef0284540d03d81ed528fb5a206f9e1720 Mon Sep 17 00:00:00 2001 From: Lan Hui <1348141770@qq.com> Date: Thu, 27 Jan 2022 12:28:41 +0800 Subject: [PATCH] Login.py: use password instead of psd because psd may cause confusion. --- app/Login.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Login.py b/app/Login.py index 289c372..c06a1b2 100644 --- a/app/Login.py +++ b/app/Login.py @@ -34,18 +34,18 @@ def check_username_availability(username): return result == [] -def change_password(username, old_psd, new_psd): +def change_password(username, old_password, new_password): ''' 修改密码 :param username: 用户名 - :param old_psd: 旧的密码 - :param new_psd: 新密码 + :param old_password: 旧的密码 + :param new_password: 新密码 :return: 修改成功:True 否则:False ''' - if not verify_user(username, old_psd): # 旧密码错误 + if not verify_user(username, old_password): # 旧密码错误 return False # 将用户名和密码一起加密,以免暴露不同用户的相同密码 - password = md5(username + new_psd) + password = md5(username + new_password) rq = InsertQuery(path_prefix + 'static/wordfreqapp.db') rq.instructions("UPDATE user SET password = '%s' WHERE name = '%s'" % (password, username)) rq.do()