From 743ce070f0319864e80a4e305c9754b30672938b Mon Sep 17 00:00:00 2001 From: shenshuo <191715030@qq.com> Date: Tue, 18 Jun 2024 11:02:48 +0800 Subject: [PATCH] =?UTF-8?q?2024=E5=B9=B46=E6=9C=8814=E6=97=A5=20=20feat(lo?= =?UTF-8?q?gin)=20=E4=BC=98=E5=8C=96=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mg/handlers/login_v5_handler.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/mg/handlers/login_v5_handler.py b/mg/handlers/login_v5_handler.py index ce71e52..d675529 100644 --- a/mg/handlers/login_v5_handler.py +++ b/mg/handlers/login_v5_handler.py @@ -93,23 +93,17 @@ async def post(self, *args, **kwargs): self.set_cookie("mfa_key", mfa_key, expires_days=1, httponly=True) if c_url: - # 暂用逻辑 - # try: - # c_domain = get_domain_from_url(c_url) - # self.set_cookie("auth_key", auth_key, domain=c_domain, expires_days=1) - # self.set_cookie("is_login", 'yes', domain=c_domain, expires_days=1) - # except Exception as err: - # logging.error(f"设置主域cookie失败 {err}") 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: - pass + logging.error(f"设置主域cookie失败 {err}") real_login_dict = dict(code=0, username=user_info.username, nickname=user_info.nickname, auth_key=auth_key, avatar=user_info.avatar, c_url=c_url, msg='登录成功') - self.write(real_login_dict) + return self.write(real_login_dict) class VerifyMFAHandler(BaseHandler, ABC):