fix: 说明页只保留复制地址
This commit is contained in:
+4
-4
@@ -3,7 +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 ToolUpgradeView from "./features/tool-upgrade/ToolUpgradeView.vue";
|
||||
import Shell from "./shell/Shell.vue";
|
||||
import AdminShell from "./shell/AdminShell.vue";
|
||||
import { isDark, themeOverrides } from "./shared/theme";
|
||||
@@ -12,7 +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";
|
||||
const isToolUpgrade = window.location.pathname.replace(/\/+$/, "") === "/tool-upgrade";
|
||||
|
||||
function applyPayload(payload: unknown) {
|
||||
if (!payload || typeof payload !== "object") return null;
|
||||
@@ -46,7 +46,7 @@ async function loadSession() {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (isNotice) return;
|
||||
if (isToolUpgrade) return;
|
||||
setSessionDenied(() => {
|
||||
void loadSession();
|
||||
});
|
||||
@@ -112,7 +112,7 @@ function onLogin(next: AppSession) {
|
||||
|
||||
<template>
|
||||
<n-config-provider class="app-root" :locale="zhCN" :date-locale="dateZhCN" :theme="isDark ? darkTheme : null" :theme-overrides="themeOverrides">
|
||||
<NoticeView v-if="isNotice" />
|
||||
<ToolUpgradeView v-if="isToolUpgrade" />
|
||||
<n-dialog-provider v-else>
|
||||
<div v-if="ready && sessionError && !session" class="gate">
|
||||
<section class="gate-card">
|
||||
|
||||
+6
-6
@@ -33,17 +33,17 @@ async function copyUrl() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main class="notice-page">
|
||||
<section class="notice-card">
|
||||
<main class="upgrade-page">
|
||||
<section class="upgrade-card">
|
||||
<h1>旧版工具已失效</h1>
|
||||
<p>因目标平台升级,旧版工具已失效,无法登录使用。新版工具已上线。</p>
|
||||
<p>请复制下面的地址,打开浏览器,粘贴到地址栏后访问。</p>
|
||||
<p ref="urlEl" class="notice-url">{{ toolUrl }}</p>
|
||||
<div class="notice-actions">
|
||||
<p ref="urlEl" class="upgrade-url">{{ toolUrl }}</p>
|
||||
<div class="upgrade-actions">
|
||||
<n-button type="primary" @click="copyUrl">{{ copied ? "已复制" : "复制地址" }}</n-button>
|
||||
</div>
|
||||
<p v-if="copied" class="notice-done">已复制。请到浏览器地址栏粘贴后访问。</p>
|
||||
<p v-else-if="copyFailed" class="notice-missed">没有复制成功,地址已选中,请手动使用CTRL+C复制。</p>
|
||||
<p v-if="copied" class="upgrade-done">已复制。请到浏览器地址栏粘贴后访问。</p>
|
||||
<p v-else-if="copyFailed" class="upgrade-missed">没有复制成功,地址已选中,请手动使用CTRL+C复制。</p>
|
||||
</section>
|
||||
</main>
|
||||
</template>
|
||||
+8
-8
@@ -1657,14 +1657,14 @@ select {
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.notice-page {
|
||||
.upgrade-page {
|
||||
min-height: 100%;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 32px 16px;
|
||||
}
|
||||
|
||||
.notice-card {
|
||||
.upgrade-card {
|
||||
width: min(440px, 100%);
|
||||
padding: 28px 24px;
|
||||
border: 1px solid var(--line);
|
||||
@@ -1672,18 +1672,18 @@ select {
|
||||
background: var(--panel);
|
||||
}
|
||||
|
||||
.notice-card h1 {
|
||||
.upgrade-card h1 {
|
||||
margin: 0 0 16px;
|
||||
font-size: 22px;
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.notice-card p {
|
||||
.upgrade-card p {
|
||||
margin: 0 0 12px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.notice-url {
|
||||
.upgrade-url {
|
||||
margin: 0 0 20px;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid var(--line);
|
||||
@@ -1694,17 +1694,17 @@ select {
|
||||
user-select: all;
|
||||
}
|
||||
|
||||
.notice-actions {
|
||||
.upgrade-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.notice-done {
|
||||
.upgrade-done {
|
||||
margin: 12px 0 0;
|
||||
color: var(--ok);
|
||||
}
|
||||
|
||||
.notice-missed {
|
||||
.upgrade-missed {
|
||||
margin: 12px 0 0;
|
||||
color: var(--warn);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user