chore: tweak api definition

This commit is contained in:
Steven
2024-04-27 22:02:15 +08:00
parent 04c78e180c
commit 9b66ef5e26
45 changed files with 1422 additions and 3231 deletions

View File

@ -80,13 +80,9 @@ const SignIn = () => {
try {
actionBtnLoadingState.setLoading();
const { user } = await authServiceClient.signIn({ username, password, neverExpire: remember });
if (user) {
await userStore.fetchCurrentUser();
navigateTo("/");
} else {
toast.error(t("message.login-failed"));
}
await authServiceClient.signIn({ username, password, neverExpire: remember });
await userStore.fetchCurrentUser();
navigateTo("/");
} catch (error: any) {
console.error(error);
toast.error((error as ClientError).details || t("message.login-failed"));