Add a little success pop up.

This commit is contained in:
吳元皓 2025-06-16 00:14:36 +08:00
parent b5217e04fe
commit 5445a3d1c0
2 changed files with 18 additions and 0 deletions

View File

@ -18,6 +18,7 @@ const user = ref("");
const enterFirstName = ref(); const enterFirstName = ref();
const isLoggedIn = ref(false); const isLoggedIn = ref(false);
const useremail = ref(); const useremail = ref();
const sendSuccess = ref(false);
const userData = ref({ const userData = ref({
userAccount: "", userAccount: "",
firstName: "", firstName: "",
@ -83,11 +84,19 @@ const submitCustomApiKey = async () => {
if (response.error) { if (response.error) {
console.error("Error updating user data:", response.error); console.error("Error updating user data:", response.error);
} }
sendSuccessSystem();
} catch (error) { } catch (error) {
console.error("Failed to submit change:", error); console.error("Failed to submit change:", error);
} }
}; };
const sendSuccessSystem = () => {
sendSuccess.value = true;
setTimeout(() => {
sendSuccess.value = false;
}, 3000);
};
const checkValidApiKey = () => { const checkValidApiKey = () => {
const apiKey = customApiKey.value; const apiKey = customApiKey.value;
if (!apiKey) { if (!apiKey) {
@ -110,6 +119,7 @@ const deleteAccount = async () => {
method: "DELETE", method: "DELETE",
}); });
const res = await req.json(); const res = await req.json();
sendSuccessSystem();
console.log(res); console.log(res);
}; };
@ -218,6 +228,13 @@ const submitUserPassword = async () => {
{{ t("settings.loginButton") }} {{ t("settings.loginButton") }}
</button> </button>
</form> </form>
<div
v-if="sendSuccess"
class="flex flex-col items-center justify-center h-full align-center text-center absloute inset-0 p-1 bg-gray-200/50 backdrop-blur-sm text-black w-full absolute align-middle z-[20]"
>
<BadgeCheckIcon class="w-12 h-12 p-1/2 m-1 text-blue-600" />
Success!
</div>
<div class="justify-center align-center text-center"> <div class="justify-center align-center text-center">
<h1 class="text-3xl text-bold p-2"> <h1 class="text-3xl text-bold p-2">
{{ t("settings.greet") {{ t("settings.greet")

View File

@ -15,6 +15,7 @@ export default defineEventHandler(async (event) => {
// Use Static values for now. // Use Static values for now.
const requestChange = body.action || ""; const requestChange = body.action || "";
const apiKeyqq = body.value.match(clearBadDataRegex); const apiKeyqq = body.value.match(clearBadDataRegex);
console.log(apiKeyqq);
const allowedColumns = ["firstname", "email"]; const allowedColumns = ["firstname", "email"];
if (!allowedColumns.includes(requestChange)) { if (!allowedColumns.includes(requestChange)) {