优化安全性

This commit is contained in:
CN-JS-HuiBai
2026-04-04 19:27:34 +08:00
parent 2d46729c27
commit 96dd30a343
2 changed files with 3 additions and 1 deletions

View File

@@ -282,7 +282,7 @@ body {
.btn-settings {
width: 40px;
height: 40px;
display: flex;
display: none;
align-items: center;
justify-content: center;
border: 1px solid var(--border-color);

View File

@@ -192,6 +192,7 @@
function updateUserUI(username) {
if (username) {
user = username;
dom.btnSettings.style.display = 'flex';
dom.userSection.innerHTML = `
<div class="user-info">
<span class="username">${escapeHtml(username)}</span>
@@ -201,6 +202,7 @@
document.getElementById('btnLogout').addEventListener('click', handleLogout);
} else {
user = null;
dom.btnSettings.style.display = 'none';
dom.userSection.innerHTML = `<button class="btn btn-login" id="btnLogin">登录</button>`;
document.getElementById('btnLogin').addEventListener('click', openLoginModal);
}