From c29f554f7f6626af8759e2f8699db41f1607df4c Mon Sep 17 00:00:00 2001 From: a76yyyy Date: Sat, 10 Feb 2024 21:47:06 +0800 Subject: [PATCH] =?UTF-8?q?Bugfix(web):=20=F0=9F=90=9B=20=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98=E6=9C=AA=E9=AA=8C=E8=AF=81=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=BC=BA=E5=88=B6=E9=AA=8C=E8=AF=81=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/handlers/site.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/handlers/site.py b/web/handlers/site.py index 449a61dba8a..50ce5252219 100644 --- a/web/handlers/site.py +++ b/web/handlers/site.py @@ -65,7 +65,7 @@ async def post(self, userid): if (await self.db.site.get(1, fields=('MustVerifyEmailEn',), sql_session=sql_session))['MustVerifyEmailEn'] != 1: raise Exception("开启 强制邮箱验证 失败") else: - await self.send_verify_mail(user) + await self.send_verify_mail(user, sql_session=sql_session) raise Exception("必须验证 管理员邮箱 才能开启, 已尝试发送验证邮件, 请查收。") else: await self.db.site.mod(1, MustVerifyEmailEn=0, sql_session=sql_session) @@ -93,10 +93,10 @@ async def post(self, userid): await self.render('utils_run_result.html', title='设置成功', flg='success') return - async def send_verify_mail(self, user): + async def send_verify_mail(self, user, sql_session=None): verified_code = [user['email'], time.time()] - verified_code = await self.db.user.encrypt(user['id'], verified_code) - verified_code = await self.db.user.encrypt(0, [user['id'], verified_code]) + verified_code = await self.db.user.encrypt(user['id'], verified_code, sql_session=sql_session) + verified_code = await self.db.user.encrypt(0, [user['id'], verified_code], sql_session=sql_session) verified_code = base64.b64encode(verified_code).decode() await gen.convert_yielded(utils.send_mail(to=user['email'], subject="QD平台 验证邮箱", html="""

 [QD平台]  {http}://{domain}