feat(frontend): polish login and design tokens

This commit is contained in:
iye
2026-06-16 12:30:45 +08:00
parent 77c037495e
commit b2288a2652
23 changed files with 828 additions and 926 deletions
+6 -4
View File
@@ -384,14 +384,16 @@ export function App() {
}, "图片已生成");
}
function onAuthed(payload: { token: string; user: User; team: Team }) {
async function onAuthed(payload: { token: string; user: User; team: Team }) {
setToken(payload.token);
setUser(payload.user);
setTeam(payload.team);
setBooting(false);
setAuthed(true);
setBooting(true);
loadData().finally(() => setBooting(false));
navigate("dashboard", { replace: true });
void loadData().catch((error) => {
console.error("[login] data hydrate failed:", error);
});
}
async function logout() {
@@ -411,7 +413,7 @@ export function App() {
initialMode={authMode}
onModeChange={(next) => {
setAuthMode(next);
window.history.pushState(null, "", next === "register" ? "/register" : "/login");
window.history.pushState(null, "", "/login");
}}
onAuthed={onAuthed}
/>