pukaad-ui-lib 1.169.1 → 1.170.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
>
|
|
8
8
|
<div class="flex flex-col gap-2 items-center">
|
|
9
9
|
<InputOTP :disabled="isTimeExp" v-model="valueOTP" />
|
|
10
|
-
<div v-if="
|
|
10
|
+
<div v-if="isLoading" class="text-center">กำลังส่งรหัสยืนยัน...</div>
|
|
11
|
+
<div v-else-if="isTimeExp" class="text-center">
|
|
11
12
|
รหัสหมดอายุ
|
|
12
13
|
<span class="text-primary cursor-pointer" @click="handleSendEmail">
|
|
13
14
|
ขอรหัสผ่านใหม่
|
|
@@ -50,6 +51,7 @@ const isOpen = defineModel({ type: Boolean, ...{
|
|
|
50
51
|
} });
|
|
51
52
|
const valueOTP = ref("");
|
|
52
53
|
const timeExp = ref("");
|
|
54
|
+
const isLoading = ref(false);
|
|
53
55
|
const displayTimeExp = CountdownTime(timeExp);
|
|
54
56
|
const isTimeExp = computed(() => {
|
|
55
57
|
return !timeExp.value || displayTimeExp.value === "00:00";
|
|
@@ -78,6 +80,7 @@ const onVerifyOTP = async () => {
|
|
|
78
80
|
};
|
|
79
81
|
const handleSendEmail = async () => {
|
|
80
82
|
try {
|
|
83
|
+
isLoading.value = true;
|
|
81
84
|
if (!props.email) throw new Error("\u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38 email");
|
|
82
85
|
const response = await api(
|
|
83
86
|
"/me/email-otp-request",
|
|
@@ -88,9 +91,11 @@ const handleSendEmail = async () => {
|
|
|
88
91
|
}
|
|
89
92
|
}
|
|
90
93
|
);
|
|
91
|
-
timeExp.value = response.expired_time;
|
|
94
|
+
timeExp.value = response.data.expired_time;
|
|
92
95
|
} catch (err) {
|
|
93
96
|
$toast.error("\u0E1E\u0E1A\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14 \u0E1A\u0E32\u0E07\u0E2D\u0E22\u0E48\u0E32\u0E07 !");
|
|
97
|
+
} finally {
|
|
98
|
+
isLoading.value = false;
|
|
94
99
|
}
|
|
95
100
|
};
|
|
96
101
|
watch(isOpen, (v) => {
|