feat(admin): Phase 0 平台超管基础 — is_platform_admin + IsPlatformAdmin + create_platform_admin(admin/admin123) + AdminAuditLog + Admin 后台外壳与路由 gating
后端:User.is_platform_admin + migration;权限类 IsPlatformAdmin;管理命令建 admin/admin123(幂等); AdminAuditLog 模型 + log_admin_action() helper;me/login 对无团队超管优雅返回 team=null;UserSerializer 暴露标志。 前端:routes/admin 后台外壳(分组侧栏 + 概览 + 占位)、/admin 路由解析与 gating(超管直落、非超管纠回)、 侧栏平台入口、admin-page.css(仅 token)、IconKitSvg 补图标。 测试:accounts 11/11 单测过;无头 e2e _admin-p0.mjs 全断言过 + 0 console error;tsc+build 绿。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
8fc3870fa3
commit
443023a1a9
@@ -0,0 +1,86 @@
|
||||
/* 平台超管后台 · 仅补充 admin 专属的少量样式;外壳/导航/卡片全部复用 design-restraint.css 共享类。
|
||||
遵守铁律:只用 token,不写裸 hex,8px 圆角,单橙 accent。 */
|
||||
|
||||
/* 品牌下方的超管标记(mono 品牌签名) */
|
||||
.admin-badge {
|
||||
margin: 2px 0 14px;
|
||||
padding: 0 4px;
|
||||
font-size: 11px;
|
||||
color: var(--black-alpha-48);
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
.admin-nav-group {
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
/* 侧栏底部:返回工作台 + 超管身份 + 退出 */
|
||||
.admin-foot {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
.admin-back {
|
||||
align-self: flex-start;
|
||||
}
|
||||
.admin-user {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 8px;
|
||||
border-radius: var(--r-md);
|
||||
}
|
||||
.admin-user .av {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 6px;
|
||||
background: var(--heat-12);
|
||||
color: var(--heat);
|
||||
display: grid;
|
||||
place-items: center;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.admin-user-meta {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
.admin-user-meta .nm {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: var(--accent-black);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.admin-user-meta .rl {
|
||||
font-size: 11px;
|
||||
color: var(--black-alpha-48);
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
.admin-logout {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 概览页快捷入口网格(复用 .shortcut 卡片) */
|
||||
.admin-tip {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.admin-shortcut-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
||||
gap: 14px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
.admin-shortcut-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 顶栏面包屑链接可点 */
|
||||
.admin-app .topbar .crumbs a {
|
||||
cursor: pointer;
|
||||
}
|
||||
Reference in New Issue
Block a user