- 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
18 lines
877 B
HTML
18 lines
877 B
HTML
<header>
|
|
<div class="container nav-container">
|
|
<a href="/" class="logo">Meta<span>Lab</span></a>
|
|
<button class="mobile-menu-btn" id="mobileMenuBtn">
|
|
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/></svg>
|
|
</button>
|
|
<ul class="nav-links" id="navLinks">
|
|
<li><a href="/">首页</a></li>
|
|
{{if .IsLoggedIn}}
|
|
<li><a href="/settings/profile" class="nav-user">{{.Username}}</a></li>
|
|
<li><a href="javascript:void(0)" class="nav-logout" id="logoutBtn">退出</a></li>
|
|
{{else}}
|
|
<li><a href="/auth/login" class="nav-login">登录</a></li>
|
|
{{end}}
|
|
</ul>
|
|
</div>
|
|
</header>
|