import {GlassButton, GlassSurface, html, TextField, useState} from 'vendor'; import {api} from './api.js'; /** 登录页。系统不开放自助注册,账号由管理员在「用户管理」中分配。 */ export function Login({onLogin}) { const [error, setError] = useState(''); const [busy, setBusy] = useState(false); const submit = async e => { e.preventDefault(); setBusy(true); setError(''); try { await api('/login', {json: Object.fromEntries(new FormData(e.currentTarget))}); history.replaceState(null, '', '/'); onLogin(); } catch (err) { setError(err.message); setBusy(false); } }; return html`
<${GlassSurface} size="large" radius=${28} className="login-card">

5G 基站退服智能分析

故障闭环管控系统 · 南宁城区

<${TextField} name="username" label="用户名" autoComplete="username" required controlSize="large" autoFocus/> <${TextField} name="password" label="密码" type="password" autoComplete="current-password" required controlSize="large" error=${error || undefined}/> <${GlassButton} type="submit" variant="glassProminent" controlSize="large" loading=${busy}>登录

默认账号 admin / admin123(管理员)· user / user123(普通用户)

`; }