支持固定登录启动模式
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user