pukaad-ui-lib 1.155.0 → 1.157.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 +1 -1
- package/dist/runtime/components/image/image-cropper.d.vue.ts +2 -2
- package/dist/runtime/components/image/image-cropper.vue.d.ts +2 -2
- package/dist/runtime/components/modal/modal-2FA-generate.vue +3 -5
- package/dist/runtime/components/modal/modal-2FA.vue +5 -6
- package/dist/runtime/components/modal/modal-secure.vue +9 -16
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
|
|
|
64
64
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
|
|
65
65
|
src: string;
|
|
66
66
|
center: boolean;
|
|
67
|
-
background: boolean;
|
|
68
|
-
modal: boolean;
|
|
69
67
|
responsive: boolean;
|
|
70
68
|
restore: boolean;
|
|
71
69
|
checkCrossOrigin: boolean;
|
|
72
70
|
checkOrientation: boolean;
|
|
73
71
|
crossorigin: "" | "anonymous" | "use-credentials";
|
|
72
|
+
modal: boolean;
|
|
74
73
|
guides: boolean;
|
|
75
74
|
highlight: boolean;
|
|
75
|
+
background: boolean;
|
|
76
76
|
autoCrop: boolean;
|
|
77
77
|
movable: boolean;
|
|
78
78
|
rotatable: boolean;
|
|
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
|
|
|
64
64
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
|
|
65
65
|
src: string;
|
|
66
66
|
center: boolean;
|
|
67
|
-
background: boolean;
|
|
68
|
-
modal: boolean;
|
|
69
67
|
responsive: boolean;
|
|
70
68
|
restore: boolean;
|
|
71
69
|
checkCrossOrigin: boolean;
|
|
72
70
|
checkOrientation: boolean;
|
|
73
71
|
crossorigin: "" | "anonymous" | "use-credentials";
|
|
72
|
+
modal: boolean;
|
|
74
73
|
guides: boolean;
|
|
75
74
|
highlight: boolean;
|
|
75
|
+
background: boolean;
|
|
76
76
|
autoCrop: boolean;
|
|
77
77
|
movable: boolean;
|
|
78
78
|
rotatable: boolean;
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
<script setup>
|
|
67
67
|
import { ref, watch } from "vue";
|
|
68
68
|
import { useClipboard } from "@/runtime/composables/useCopy";
|
|
69
|
-
import {
|
|
70
|
-
const
|
|
69
|
+
import { useApi } from "../../composables/useApi";
|
|
70
|
+
const api = useApi();
|
|
71
71
|
const { copyToClipboard } = useClipboard();
|
|
72
72
|
const emit = defineEmits(["complete"]);
|
|
73
73
|
const props = defineProps({
|
|
@@ -86,9 +86,7 @@ const isDisabled = ref(true);
|
|
|
86
86
|
const twoFaGenerate = async () => {
|
|
87
87
|
try {
|
|
88
88
|
isLoading.value = true;
|
|
89
|
-
const { status, data } = await
|
|
90
|
-
credentials: "include"
|
|
91
|
-
});
|
|
89
|
+
const { status, data } = await api("/me/two-fa-generate");
|
|
92
90
|
if (status !== "success") throw "Generate \u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08";
|
|
93
91
|
key.value = data.key;
|
|
94
92
|
barcode2FA.value = data.qr_code;
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
|
|
25
25
|
<script setup>
|
|
26
26
|
import { ref, watch } from "vue";
|
|
27
|
-
import {
|
|
28
|
-
const
|
|
27
|
+
import { useApi } from "../../composables/useApi";
|
|
28
|
+
const api = useApi();
|
|
29
29
|
const emit = defineEmits(["complete"]);
|
|
30
30
|
const props = defineProps({
|
|
31
31
|
phone: { type: String, required: false },
|
|
@@ -42,15 +42,14 @@ const valueOTP = ref("");
|
|
|
42
42
|
const isLoading = ref(false);
|
|
43
43
|
const onVerify2FA = async () => {
|
|
44
44
|
try {
|
|
45
|
-
const { data } = await
|
|
46
|
-
!props.phone ?
|
|
45
|
+
const { data } = await api(
|
|
46
|
+
!props.phone ? "/me/two-fa-verify" : "/auth/two-fa-verify",
|
|
47
47
|
{
|
|
48
48
|
method: "POST",
|
|
49
49
|
body: {
|
|
50
50
|
phone: props.phone,
|
|
51
51
|
code: valueOTP.value
|
|
52
|
-
}
|
|
53
|
-
credentials: "include"
|
|
52
|
+
}
|
|
54
53
|
}
|
|
55
54
|
);
|
|
56
55
|
if (!data) throw "error";
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script setup>
|
|
15
|
-
import { useNuxtApp
|
|
15
|
+
import { useNuxtApp } from "nuxt/app";
|
|
16
16
|
import { reactive, watch, ref } from "vue";
|
|
17
|
+
import { useApi } from "../../composables/useApi";
|
|
17
18
|
import ModalPasswordVerify from "@/runtime/components/modal/modal-password-verify.vue";
|
|
18
19
|
import ModalPasswordNew from "@/runtime/components/modal/modal-password-new.vue";
|
|
19
20
|
import Modal2FA from "@/runtime/components/modal/modal-2FA.vue";
|
|
@@ -21,7 +22,7 @@ import Modal2FAGenerate from "@/runtime/components/modal/modal-2FA-generate.vue"
|
|
|
21
22
|
import ModalPhoneOTP from "@/runtime/components/modal/modal-phone-OTP.vue";
|
|
22
23
|
import ModalEmailOTP from "@/runtime/components/modal/modal-email-OTP.vue";
|
|
23
24
|
const { $toast } = useNuxtApp();
|
|
24
|
-
const
|
|
25
|
+
const api = useApi();
|
|
25
26
|
const emit = defineEmits(["complete"]);
|
|
26
27
|
const props = defineProps({
|
|
27
28
|
state: { type: String, required: true },
|
|
@@ -126,13 +127,9 @@ const handleComplete = (key) => {
|
|
|
126
127
|
};
|
|
127
128
|
const onEnabled2FA = async () => {
|
|
128
129
|
try {
|
|
129
|
-
const { status } = await
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
method: "POST",
|
|
133
|
-
credentials: "include"
|
|
134
|
-
}
|
|
135
|
-
);
|
|
130
|
+
const { status } = await api("/me/two-fa-enabled", {
|
|
131
|
+
method: "POST"
|
|
132
|
+
});
|
|
136
133
|
if (status != "success") throw "2FA \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07";
|
|
137
134
|
$toast.success("\u0E40\u0E1B\u0E34\u0E14\u0E01\u0E32\u0E23\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E15\u0E31\u0E27\u0E15\u0E19\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08 !");
|
|
138
135
|
isOpen.value = false;
|
|
@@ -144,13 +141,9 @@ const onEnabled2FA = async () => {
|
|
|
144
141
|
};
|
|
145
142
|
const onDisabled2FA = async () => {
|
|
146
143
|
try {
|
|
147
|
-
const { status } = await
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
method: "POST",
|
|
151
|
-
credentials: "include"
|
|
152
|
-
}
|
|
153
|
-
);
|
|
144
|
+
const { status } = await api("/me/two-fa-disabled", {
|
|
145
|
+
method: "POST"
|
|
146
|
+
});
|
|
154
147
|
if (status != "success") throw "2FA \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07";
|
|
155
148
|
$toast.success("\u0E1B\u0E34\u0E14\u0E01\u0E32\u0E23\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E15\u0E31\u0E27\u0E15\u0E19\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08 !");
|
|
156
149
|
isOpen.value = false;
|