Skip to content

Commit

Permalink
feat(login): add validator for login panel
Browse files Browse the repository at this point in the history
  • Loading branch information
fu050409 committed May 21, 2024
1 parent 0854733 commit 1586216
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/LoginPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ const toast = useToast();
const accountStore = useAccountStore();
async function login() {
if (!username.value || !password.value) {
toast.add({ severity: 'error', summary: 'Invalid Input', detail: 'Please enter both username and password', life: 3000 });
return;
}
const result: { status: boolean; msg: string, account: Account } = await invoke("login", {
username: username.value,
password: password.value
Expand Down

0 comments on commit 1586216

Please sign in to comment.