From 8a2331886260e2858e2ac0ff4eb0606170809ded Mon Sep 17 00:00:00 2001 From: Nixevol Date: Sun, 25 Oct 2026 06:59:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=99=BB=E5=BD=95=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E5=90=8E=E5=9B=9E=E5=88=B0=E7=99=BB=E5=BD=95=E9=A1=B5=E5=B9=B6?= =?UTF-8?q?=E5=8F=AA=E6=8F=90=E7=A4=BA=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- desktop/src/App.vue | 16 +++++++++++++++- desktop/src/features/auth/LoginView.vue | 2 ++ .../features/download/DownloadManagerView.vue | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/desktop/src/App.vue b/desktop/src/App.vue index eb2e2d1..a330638 100644 --- a/desktop/src/App.vue +++ b/desktop/src/App.vue @@ -5,15 +5,29 @@ import LoginView from "./features/auth/LoginView.vue"; import Shell from "./shell/Shell.vue"; import type { UserInfo } from "./features/auth/api"; import { isDark, themeOverrides } from "./shared/theme"; +import { clearUnauthorized, setUnauthorizedHandler } from "./shared/http"; const user = ref(null); +const authNotice = ref(""); + +setUnauthorizedHandler(() => { + if (!user.value) return; + user.value = null; + authNotice.value = "登录已失效,请重新登录"; +}); + +function onSuccess(next: UserInfo) { + authNotice.value = ""; + clearUnauthorized(); + user.value = next; +}