支持固定登录启动模式

This commit is contained in:
zhangshun
2026-05-25 10:38:18 +08:00
parent c2ac560527
commit 318105443a
6 changed files with 93 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ import "./dialogs.css";
export async function renderApp() {
const currentUser = getCurrentUser();
const isAdmin = currentUser?.role === "admin";
const isFixedLogin = document.body.dataset.authMode === "fixed";
document.querySelector<HTMLDivElement>("#app")!.innerHTML = `
<div class="app-shell">
<header class="topbar">
@@ -18,7 +19,7 @@ export async function renderApp() {
</div>
<div class="topbar-actions">
<span>${currentUser?.username ?? ""}</span>
<button id="logoutBtn" class="icon-text-btn">退出</button>
${isFixedLogin ? "" : `<button id="logoutBtn" class="icon-text-btn">退出</button>`}
</div>
</header>
<section id="workspaceLayout" class="workspace"></section>
@@ -67,7 +68,7 @@ export async function renderApp() {
renderWorkspaceLayout();
document.querySelector("#logoutBtn")!.addEventListener("click", () => {
document.querySelector("#logoutBtn")?.addEventListener("click", () => {
clearSession();
renderLogin(renderApp);
});