网吧空调智能控制
Netbar AC Smart Control
r.json().then(data => ({ ok: r.ok, data }))) .then(async ({ ok, data }) => { loading = false; if (ok) { localStorage.setItem('token', data.access_token); // Fetch user role to determine redirect const meRes = await fetch('/auth/me', { headers: { 'Authorization': 'Bearer ' + data.access_token } }); const me = await meRes.json(); if (me.role === 'superadmin') { window.location.href = '/static/admin/index.html'; } else if (me.role === 'agent') { window.location.href = '/static/agent/index.html'; } else { window.location.href = '/static/owner/index.html'; } } else { error = data.detail || '登录失败'; } }) .catch(() => { loading = false; error = '网络错误'; }); ">
用户名
密码