further implementing service page (#3)

This commit is contained in:
UUBulb
2024-11-17 10:05:20 +08:00
committed by GitHub
parent 55821320dc
commit 6e3f888792
20 changed files with 936 additions and 333 deletions

View File

@@ -32,8 +32,9 @@ export const AuthProvider = ({ children }: {
const login = async (username: string, password: string) => {
try {
await loginRequest(username, password)
setProfile({ username: username });
await loginRequest(username, password);
const user = await getProfile();
setProfile(user);
navigate("/dashboard");
} catch (error: any) {
toast(error.message);