This commit is contained in:
fengchuanhn@gmail.com
2026-05-15 18:50:42 +08:00
parent 584d4c47a1
commit 28b2b4d686
9 changed files with 218 additions and 53 deletions

View File

@@ -5,8 +5,8 @@ import { useAuthStore } from "../stores/auth";
const router = useRouter();
const auth = useAuthStore();
function onLogout() {
auth.logout();
async function onLogout() {
await auth.logout();
router.push({ name: "login" });
}
</script>

View File

@@ -16,7 +16,7 @@ async function onSubmit() {
feedback.value = { severity: "", message: "" };
loading.value = true;
const result = auth.login({
const result = await auth.login({
username: username.value,
password: password.value,
});

View File

@@ -17,7 +17,7 @@ async function onSubmit() {
feedback.value = { severity: "", message: "" };
loading.value = true;
const result = auth.register({
const result = await auth.register({
username: username.value,
password: password.value,
confirmPassword: confirmPassword.value,