JustXing Admin
超级管理后台
{ loading=true; error=''; try { const res = await fetch('/api/auth/login', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({username, password}) }); if (!res.ok) { const d = await res.json(); error = d.detail || '登录失败'; } else { const d = await res.json(); localStorage.setItem('token', d.token); location.href = '/dashboard'; } } catch(e) { error = '网络错误'; } loading=false; }">
用户名
密码
登录
登录中...