feat: 增加升级说明页,退出弹窗默认选退出系统

This commit is contained in:
Nixevol
2026-11-18 10:22:53 +08:00
parent 3670a76dfe
commit 71373839c6
6 changed files with 119 additions and 5 deletions
+5 -1
View File
@@ -3,6 +3,7 @@ import { onMounted, onUnmounted, ref } from "vue";
import { apiFetch, setSessionDenied } from "./shared/http";
import { darkTheme, dateZhCN, NButton, NConfigProvider, NDialogProvider, zhCN } from "naive-ui";
import LoginView from "./features/auth/LoginView.vue";
import NoticeView from "./features/notice/NoticeView.vue";
import Shell from "./shell/Shell.vue";
import AdminShell from "./shell/AdminShell.vue";
import { isDark, themeOverrides } from "./shared/theme";
@@ -11,6 +12,7 @@ import { sessionFromPayload, type AppSession } from "./shared/session";
const ready = ref(false);
const session = ref<AppSession | null>(null);
const sessionError = ref("");
const isNotice = window.location.pathname.replace(/\/+$/, "") === "/msg01";
function applyPayload(payload: unknown) {
if (!payload || typeof payload !== "object") return null;
@@ -44,6 +46,7 @@ async function loadSession() {
}
onMounted(() => {
if (isNotice) return;
setSessionDenied(() => {
void loadSession();
});
@@ -109,7 +112,8 @@ function onLogin(next: AppSession) {
<template>
<n-config-provider class="app-root" :locale="zhCN" :date-locale="dateZhCN" :theme="isDark ? darkTheme : null" :theme-overrides="themeOverrides">
<n-dialog-provider>
<NoticeView v-if="isNotice" />
<n-dialog-provider v-else>
<div v-if="ready && sessionError && !session" class="gate">
<section class="gate-card">
<p class="session-note">暂时无法确认登录状态</p>