fix: 设计原则审查修复 — DIP/ISP, LoD, DRY, OCP, URL, 301缓存

- P0 DIP+ISP: 全链路注入接口,消除零接口紧耦合
- P0 URL: auth 301→302,修复登出后浏览器缓存陷阱
- P1 DRY: JWT 认证逻辑收敛至 TokenService+中间件
- P2 DRY: 前后端角色/状态映射统一为 model 常量
- P2 LoD: 新增 SettingsController,router 不再跨层调 repo
- P2 URL: settings ?tab= → /settings/:tab 伪静态
- P3 OCP: 角色权限 map 化,告别硬编码 switch
This commit is contained in:
2026-05-26 21:12:19 +08:00
parent 483fdd919f
commit 39d13993ba
37 changed files with 961 additions and 260 deletions

View File

@ -3,16 +3,23 @@
仅在首页加载,通过 ExtraCSS 注入
============================================================ */
/* ---------- Two-column layout ---------- */
.home-layout {
display: flex;
min-height: 100vh;
align-items: stretch;
}
/* ---------- Hero ---------- */
.hero {
min-height: 100vh;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
padding: 4rem 0;
text-align: center;
background: linear-gradient(180deg, #fff 0%, #f0f4f8 100%);
scroll-snap-align: start;
min-width: 0;
}
.hero h1 {
@ -105,7 +112,6 @@
flex-direction: column;
justify-content: center;
padding: 1.5rem 0;
scroll-snap-align: start;
}
.plans .section-title {
@ -185,7 +191,6 @@
justify-content: center;
padding: 4rem 0;
background: var(--color-surface);
scroll-snap-align: start;
}
.features-grid {
@ -220,7 +225,6 @@
height: 100vh;
display: flex;
flex-direction: column;
scroll-snap-align: start;
}
.timeline-vision {
@ -316,6 +320,84 @@
font-size: .95rem;
}
/* ---------- Sidebar ---------- */
.sidebar {
width: 300px;
flex-shrink: 0;
padding: 4rem 20px 4rem 0;
display: flex;
flex-direction: column;
gap: 1rem;
}
.sidebar-card {
background: var(--color-surface);
border-radius: var(--radius);
box-shadow: var(--shadow);
border: 1px solid var(--color-border);
padding: 1.5rem;
}
/* --- User Card --- */
.user-card {
text-align: center;
}
.user-card-avatar {
width: 56px;
height: 56px;
border-radius: 50%;
background: var(--color-accent);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto .8rem;
font-size: 1.5rem;
font-weight: 700;
text-transform: uppercase;
}
.user-card-name {
font-size: 1.1rem;
font-weight: 600;
color: var(--color-primary);
margin-bottom: .3rem;
}
.user-card-desc {
font-size: .85rem;
color: var(--color-text-light);
margin-bottom: 1rem;
}
.user-card-link {
display: inline-block;
font-size: .85rem;
color: var(--color-accent);
font-weight: 500;
transition: var(--transition);
}
.user-card-link:hover {
opacity: .8;
}
.user-card-btn {
display: inline-block;
padding: .5rem 1.8rem;
background: var(--color-accent);
color: #fff;
border-radius: var(--radius);
font-size: .9rem;
font-weight: 500;
transition: var(--transition);
}
.user-card-btn:hover {
opacity: .85;
}
/* ---------- Responsive (首页专属) ---------- */
@media (max-width: 768px) {
.hero h1 {
@ -327,16 +409,15 @@
.hero-desc {
font-size: 1.05rem;
}
.timeline {
justify-content: flex-start;
gap: 1.5rem;
padding: 2rem 20px 1.5rem;
scroll-snap-type: x mandatory;
}
.timeline-item {
min-width: 240px;
max-width: 280px;
scroll-snap-align: start;
}
.timeline::before {
left: 20px;