From d9457dea721670191ffcb8b9714af8bf15d459c7 Mon Sep 17 00:00:00 2001 From: orangebabu <2409692770@qq.com> Date: Tue, 20 Aug 2024 10:57:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B7=E6=96=B0state?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/routes/passport/login/login.component.ts | 10 +++++++++- .../dromara/maxkey/web/contorller/LoginEntryPoint.java | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/maxkey-web-frontend/maxkey-web-app/src/app/routes/passport/login/login.component.ts b/maxkey-web-frontend/maxkey-web-app/src/app/routes/passport/login/login.component.ts index 82e9e2756..69a90e6a9 100644 --- a/maxkey-web-frontend/maxkey-web-app/src/app/routes/passport/login/login.component.ts +++ b/maxkey-web-frontend/maxkey-web-app/src/app/routes/passport/login/login.component.ts @@ -102,6 +102,13 @@ export class UserLoginComponent implements OnInit, OnDestroy { //init socials,state this.authnService.clear(); + + this.get(); + + this.cdr.detectChanges(); + } + + get() { this.authnService .get({ remember_me: localStorage.getItem(CONSTS.REMEMBER) }) .pipe( @@ -141,7 +148,6 @@ export class UserLoginComponent implements OnInit, OnDestroy { } } }); - this.cdr.detectChanges(); } congressLogin(congress: string) { @@ -343,6 +349,8 @@ export class UserLoginComponent implements OnInit, OnDestroy { this.authnService.navigate({}); } else if (res.code === 20004) { this.qrexpire = true; + } else if (res.code === 20005) { + this.get() } // Handle response here diff --git a/maxkey-webs/maxkey-web-maxkey/src/main/java/org/dromara/maxkey/web/contorller/LoginEntryPoint.java b/maxkey-webs/maxkey-web-maxkey/src/main/java/org/dromara/maxkey/web/contorller/LoginEntryPoint.java index 75244a47a..7ee381cca 100644 --- a/maxkey-webs/maxkey-web-maxkey/src/main/java/org/dromara/maxkey/web/contorller/LoginEntryPoint.java +++ b/maxkey-webs/maxkey-web-maxkey/src/main/java/org/dromara/maxkey/web/contorller/LoginEntryPoint.java @@ -314,9 +314,9 @@ public class LoginEntryPoint { } catch (BusinessException businessException) { return new Message<>(businessException.getCode(), businessException.getMessage()); } + } else { + return new Message<>(20005, "state失效重新获取"); } - - return new Message<>(Message.FAIL); } @Operation(summary = "app扫描二维码", description = "扫描二维码登录", method = "POST")