From 27d8bd0bb9e563443a11ff0164eea30a1ed0e984 Mon Sep 17 00:00:00 2001 From: shenshuo <191715030@qq.com> Date: Wed, 13 Nov 2024 10:48:04 +0800 Subject: [PATCH] =?UTF-8?q?2024=E5=B9=B411=E6=9C=8813=E6=97=A5=20=20?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=A0=B9=E5=9F=9Fcookie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mg/handlers/login_v5_handler.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/mg/handlers/login_v5_handler.py b/mg/handlers/login_v5_handler.py index 6e756a3..927cbdf 100644 --- a/mg/handlers/login_v5_handler.py +++ b/mg/handlers/login_v5_handler.py @@ -99,21 +99,21 @@ async def post(self, *args, **kwargs): if mfa_key: self.set_cookie("mfa_key", mfa_key, expires_days=1, httponly=True) - if c_url: - try: - root_domain = self.request.headers.get('Codo-root-domain') - self.set_cookie("auth_key", auth_key, domain=root_domain, expires_days=1) - self.set_cookie("is_login", 'yes', domain=root_domain, expires_days=1) - logging.info(f"设置主域Cookie {root_domain}") - except Exception as err: - logging.error(f"设置主域cookie失败 {err}") - + # if c_url: + # try: + # root_domain = self.request.headers.get('Codo-root-domain') + # self.set_cookie("auth_key", auth_key, domain=root_domain, expires_days=1) + # self.set_cookie("is_login", 'yes', domain=root_domain, expires_days=1) + # logging.info(f"设置主域Cookie {root_domain}") + # except Exception as err: + # logging.error(f"设置主域cookie失败 {err}") + # real_login_dict = dict(code=0, msg='登录成功', - username=user_info.username, - nickname=user_info.nickname, - auth_key=auth_key, - avatar=user_info.avatar, - c_url=c_url, + # username=user_info.username, + # nickname=user_info.nickname, + # auth_key=auth_key, + # avatar=user_info.avatar, + # c_url=c_url, data=dict(username=user_info.username, nickname=user_info.nickname, auth_key=auth_key, avatar=user_info.avatar, c_url=c_url)) return self.write(real_login_dict)