From 9d1e94d3c21695e410cb5753c8ab251d09e16ce4 Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Fri, 10 Jun 2022 18:22:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=B3=BB=E7=BB=9F=E7=94=A8=E6=88=B7=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5RemoteApp=E5=BA=94=E7=94=A8=E8=8E=B7=E5=8F=96=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E8=AE=A4=E8=AF=81=E4=BF=A1=E6=81=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/models/user.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/assets/models/user.py b/apps/assets/models/user.py index ce0029768..e20664071 100644 --- a/apps/assets/models/user.py +++ b/apps/assets/models/user.py @@ -133,6 +133,15 @@ class AuthMixin: self.password = password def load_app_more_auth(self, app_id=None, username=None, user_id=None): + # 清除认证信息 + self._clean_auth_info_if_manual_login_mode() + + # 先加载临时认证信息 + if self.login_mode == self.LOGIN_MANUAL: + self._load_tmp_auth_if_has(app_id, user_id) + return + + # Remote app from applications.models import Application app = get_object_or_none(Application, pk=app_id) if app and app.category_remote_app: @@ -141,11 +150,6 @@ class AuthMixin: return # Other app - self._clean_auth_info_if_manual_login_mode() - # 加载临时认证信息 - if self.login_mode == self.LOGIN_MANUAL: - self._load_tmp_auth_if_has(app_id, user_id) - return # 更新用户名 from users.models import User user = get_object_or_none(User, pk=user_id) if user_id else None