fix: unified nav - TopHud back btn + window controls + login close

This commit is contained in:
Chen Gu
2026-05-09 14:32:04 +08:00
parent dc3db7549c
commit 27de14f752
4 changed files with 57 additions and 14 deletions

View File

@@ -7,6 +7,10 @@ import { useAuth } from '../hooks/useAuth';
import { useAuthStore } from '../stores/authStore';
import { getVipStatus, activateVip } from '../services/auth.api';
function callElectron(method: string) {
try { (window as any).electronAPI?.[method](); } catch {}
}
export default function Login() {
const navigate = useNavigate();
const { login } = useAuth();
@@ -50,15 +54,20 @@ export default function Login() {
return (
<div className="h-screen bg-[#1a1a1a] flex flex-col items-center justify-center p-6">
{/* 品牌 */}
{/* 关闭按钮 */}
<button
onClick={() => callElectron('closeWindow')}
className="absolute top-3 right-3 text-[#555] hover:text-[#cc3300] text-[14px] px-2 py-1 border border-[#333] hover:border-[#cc3300] transition-colors duration-75"
>
</button>
<div className="text-center mb-6">
<h1 className="text-[14px] font-bold tracking-[0.2em] uppercase text-[#e0e0e0]"> 2.0</h1>
<p className="text-[8px] font-mono text-[#555] mt-1"></p>
</div>
{/* 认证卡片 */}
<Card className="w-full max-w-xs" serial="AUTH-01">
{/* 标签页 */}
<div className="flex border-b border-[#333]">
{(['login', 'register', 'vip'] as const).map(t => (
<button
@@ -73,7 +82,6 @@ export default function Login() {
))}
</div>
{/* 表单 */}
<div className="p-3 space-y-2.5">
{tab === 'vip' ? (
<>
@@ -122,13 +130,10 @@ export default function Login() {
</p>
)}
<p className="text-[7px] font-mono text-[#444] text-center">
SYS-AUTH v1.0
</p>
<p className="text-[7px] font-mono text-[#444] text-center">SYS-AUTH v1.0</p>
</div>
</Card>
{/* 返回 */}
<button
onClick={() => navigate('/')}
className="mt-4 text-[8px] font-mono text-[#555] hover:text-[#888] transition-colors duration-75"