feat: 一键部署脚本 + Dashboard按钮移至标题下方 + 修复演示模式退出
This commit is contained in:
@@ -19,6 +19,12 @@ export function TopBar({ pageTitle, onMenuToggle }: TopBarProps) {
|
||||
const handleLogout = () => {
|
||||
if (isAuthenticated) {
|
||||
logout()
|
||||
} else {
|
||||
// 演示模式:清除 auth_role 退出到登录页
|
||||
localStorage.removeItem('auth_role')
|
||||
localStorage.removeItem('auth_name')
|
||||
localStorage.removeItem('auth_station')
|
||||
window.location.reload()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -139,13 +139,15 @@ export function Dashboard({ records, onNavigate, onCreate, onSelect }: Dashboard
|
||||
<span>{role === 'reporter' ? '这是你的个人工作概况。' : role === 'station' ? '这是本站今日运行概况。' : '这里是全国记者站今日运行概况。'}</span>
|
||||
</div>
|
||||
</div>
|
||||
{role !== 'headquarters' && (
|
||||
</div>
|
||||
{role !== 'headquarters' && (
|
||||
<div style={{ marginBottom: 16 }}>
|
||||
<button className="primary-button" onClick={onCreate}>
|
||||
<Plus size={18} />
|
||||
新建工作记录
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="metric-grid">
|
||||
<div onClick={() => setDrillDown('pending')} style={{ cursor: 'pointer' }}>
|
||||
|
||||
Reference in New Issue
Block a user