Fix settings aka it does not do stuff when the user has logged in.

This commit is contained in:
吳元皓 2025-06-12 23:16:24 +08:00
parent 10e1354f27
commit 075e33d2af

View File

@ -27,6 +27,10 @@ const userData = ref({
});
const enteruseremail = ref();
onMounted(async () => {
await validateUserInfo();
});
const validateUserInfo = async () => {
const req = await fetch("/api/user/validateUserToken");
const res = await req.json();
if (res.current_spot === "LOGOUT") {
@ -37,7 +41,7 @@ onMounted(async () => {
userData.value = res;
useremail.value = res.email;
isLoggedIn.value = true;
});
};
const emit = defineEmits(["windowopener"]);
@ -166,6 +170,7 @@ const submitUserPassword = async () => {
success.value = true;
console.log(res);
userAccount.value = "";
await validateUserInfo();
} else {
error.value = true;
errormsg.value = res.error;