From 86533a51a99b46cca74a7d21fdd4e65cf8b2cb3e Mon Sep 17 00:00:00 2001 From: kpt <2817151932@qq.com> Date: Wed, 3 Jul 2024 18:39:27 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90user.py=E3=80=91=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BA=86=E5=93=88=E5=B8=8C=E6=98=AF=E5=85=A8=E5=B1=80=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/user/user.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/views/user/user.py b/views/user/user.py index 303605a..79f60bd 100644 --- a/views/user/user.py +++ b/views/user/user.py @@ -5,7 +5,6 @@ from flask import Blueprint, redirect, render_template, request, Flask, session from utils.query import query from utils.errorResponse import errorResponse -hash_with_salt = hashlib.sha256('XiaoXueQi2024'.encode('utf-8')) ub = Blueprint('user', __name__, url_prefix='/user', @@ -19,6 +18,7 @@ def login(): else: def filter_fn(user): + hash_with_salt = hashlib.sha256('XiaoXueQi2024'.encode('utf-8')) hash_with_salt.update(request.form['password'].encode('utf-8')) return request.form[ 'username'] in user and hash_with_salt.hexdigest in user @@ -48,6 +48,7 @@ def register(): return errorResponse('该用户名已被注册') else: time_tuple = time.localtime(time.time()) + hash_with_salt = hashlib.sha256('XiaoXueQi2024'.encode('utf-8')) hash_with_salt.update(request.form['password'].encode('utf-8')) query( '''