From 76342553ad9a48417ed760e7641580bda82a5b52 Mon Sep 17 00:00:00 2001 From: SikongJueluo Date: Wed, 13 Aug 2025 14:36:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=A4=E8=AF=81=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=AE=9E=E6=97=B6=E8=8E=B7=E5=8F=96token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/AuthManager.ts | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/utils/AuthManager.ts b/src/utils/AuthManager.ts index 50c47b8..c2f8544 100644 --- a/src/utils/AuthManager.ts +++ b/src/utils/AuthManager.ts @@ -212,30 +212,18 @@ export class AuthManager { } public static createAuthenticatedJtagHubConnection() { - const token = this.getToken(); - if (isNull(token)) { - router.push("/login"); - throw Error("Token Null!"); - } - return new HubConnectionBuilder() .withUrl("http://127.0.0.1:5000/hubs/JtagHub", { - accessTokenFactory: () => token, + accessTokenFactory: () => this.getToken() ?? "", }) .withAutomaticReconnect() .build(); } public static createAuthenticatedProgressHubConnection() { - const token = this.getToken(); - if (isNull(token)) { - router.push("/login"); - throw Error("Token Null!"); - } - return new HubConnectionBuilder() .withUrl("http://127.0.0.1:5000/hubs/ProgressHub", { - accessTokenFactory: () => token, + accessTokenFactory: () => this.getToken() ?? "", }) .withAutomaticReconnect() .build();