feat(dnfs): 左上角用户信息面板(默认折叠),新增 /whoami 身份接口
dnfs 新增 POST /whoami:解 Token payload 返回 user/is_admin,无或畸形 Token 返回 login=false(HttpOnly Cookie 模式下 JS 无法读 Token,身份 必须由后端下发);static 加 /whoami 代理(Cookie 转 Bearer);前端 dnfs.html 左上新增 userpanel,镜像 minimap 样式默认折叠,展开显示 用户名/角色/退出登录(POST /logout 清 Cookie 后跳登录页)。
This commit is contained in:
1 parent
1388fcb72b
commit
8c1956cdeb
5 files changed
+131
-6
No files matched your search
@@ -365,6 +365,33 @@ input[type="button"]:disabled {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* ===== User Panel (dnfs 左上角用户信息,镜像 minimap 样式) ===== */
|
||||
.userpanel {
|
||||
position: fixed;
|
||||
left: 1rem;
|
||||
top: 1rem;
|
||||
z-index: 100;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.4rem;
|
||||
max-height: 80vh;
|
||||
overflow-y: auto;
|
||||
padding: 0.6rem 0.75rem;
|
||||
border-radius: var(--radius-md);
|
||||
background: rgba(253, 246, 238, 0.72);
|
||||
border: 1px solid var(--border-light);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
box-shadow: var(--shadow-md);
|
||||
transition: background 0.2s, border-color 0.2s;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.userpanel {
|
||||
background: rgba(30, 23, 18, 0.72);
|
||||
border-color: var(--border);
|
||||
}
|
||||
}
|
||||
|
||||
/* ===== Minimap (dnfs) ===== */
|
||||
.minimap {
|
||||
position: fixed;
|
||||
@@ -392,8 +419,8 @@ input[type="button"]:disabled {
|
||||
border-color: var(--border);
|
||||
}
|
||||
}
|
||||
.minimap:empty { display: none; }
|
||||
.minimap .tag {
|
||||
.minimap:empty, .userpanel:empty { display: none; }
|
||||
.minimap .tag, .userpanel .tag {
|
||||
display: inline-block;
|
||||
max-width: 140px;
|
||||
overflow: hidden;
|
||||
@@ -416,18 +443,18 @@ input[type="button"]:disabled {
|
||||
border-radius: 4px;
|
||||
}
|
||||
.minimap::-webkit-scrollbar-thumb:hover { background: var(--muted); }
|
||||
.minimap .tag:hover {
|
||||
.minimap .tag:hover, .userpanel .tag:hover {
|
||||
color: var(--accent-dark);
|
||||
background: var(--accent-soft);
|
||||
border-color: var(--accent);
|
||||
}
|
||||
.minimap .tag.back {
|
||||
.minimap .tag.back, .userpanel .tag.back {
|
||||
color: var(--accent);
|
||||
background: var(--accent-soft);
|
||||
border-color: var(--accent);
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
.minimap .tag.fold-btn {
|
||||
.minimap .tag.fold-btn, .userpanel .tag.fold-btn {
|
||||
color: var(--fg-secondary);
|
||||
background: transparent;
|
||||
border: 1px solid var(--border);
|
||||
@@ -438,7 +465,7 @@ input[type="button"]:disabled {
|
||||
cursor: pointer;
|
||||
transition: color 0.15s, background 0.15s, border-color 0.15s;
|
||||
}
|
||||
.minimap .tag.fold-btn:hover {
|
||||
.minimap .tag.fold-btn:hover, .userpanel .tag.fold-btn:hover {
|
||||
color: var(--accent-dark);
|
||||
background: var(--accent-soft);
|
||||
border-color: var(--accent);
|
||||
|
||||
Reference in new issue
Block a user