adata-ui 2.1.10 → 2.1.12
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.
|
@@ -42,6 +42,10 @@ function goRegister() {
|
|
|
42
42
|
registrationModal.value = true
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
+
const close = () => {
|
|
46
|
+
isOpen.value = false
|
|
47
|
+
emit('close')
|
|
48
|
+
}
|
|
45
49
|
</script>
|
|
46
50
|
|
|
47
51
|
<template>
|
|
@@ -63,7 +67,7 @@ function goRegister() {
|
|
|
63
67
|
<a-button
|
|
64
68
|
view="outline"
|
|
65
69
|
block
|
|
66
|
-
@click="
|
|
70
|
+
@click="close"
|
|
67
71
|
>
|
|
68
72
|
{{ t('modals.buttons.close') }}
|
|
69
73
|
</a-button>
|
|
@@ -10,6 +10,11 @@ const { t, locale } = useI18n()
|
|
|
10
10
|
const { pk, landing } = useUrls()
|
|
11
11
|
const route = useRoute()
|
|
12
12
|
|
|
13
|
+
const { myLayer } = useAppConfig()
|
|
14
|
+
const mode = myLayer.mode
|
|
15
|
+
|
|
16
|
+
const COOKIE_DOMAIN = `.${mode}.kz`
|
|
17
|
+
|
|
13
18
|
const regex = /^\/counterparty\/main\/company\/\d+\/basic-info$/;
|
|
14
19
|
|
|
15
20
|
const { loginModal, registrationModal, recoveryModal, confirmAccountOtpModal, twoFactorModal, intermediateState } = useIdModals()
|
|
@@ -42,20 +47,23 @@ function getError(path: string) {
|
|
|
42
47
|
function savePassAndLogin(form: { username: string, password: string }) {
|
|
43
48
|
const { username, password } = form
|
|
44
49
|
const cookieOptions = {
|
|
50
|
+
domain: COOKIE_DOMAIN,
|
|
45
51
|
expires: rememberMe.value ? new Date(Date.now() + 14 * 24 * 60 * 60 * 1000) : undefined, // Срок действия 14 дней
|
|
46
52
|
}
|
|
47
53
|
useCookie('username', cookieOptions).value = username
|
|
48
54
|
useCookie('password', cookieOptions).value = password
|
|
49
55
|
}
|
|
50
56
|
function clearAuthCookie() {
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
const options = { domain: COOKIE_DOMAIN }
|
|
58
|
+
|
|
59
|
+
useCookie('username', options).value = null
|
|
60
|
+
useCookie('password', options).value = null
|
|
53
61
|
}
|
|
54
62
|
|
|
55
63
|
const loading = ref(false)
|
|
56
64
|
const form: ILoginForm = reactive({
|
|
57
|
-
username: useCookie('username').value || '',
|
|
58
|
-
password: useCookie('password').value || '',
|
|
65
|
+
username: useCookie('username', { domain: COOKIE_DOMAIN }).value || '',
|
|
66
|
+
password: useCookie('password', { domain: COOKIE_DOMAIN }).value || '',
|
|
59
67
|
})
|
|
60
68
|
const rememberMe = ref(false)
|
|
61
69
|
|
|
@@ -126,7 +134,7 @@ async function submit() {
|
|
|
126
134
|
|
|
127
135
|
useCookie('accessToken', {
|
|
128
136
|
maxAge: expire_in,
|
|
129
|
-
domain:
|
|
137
|
+
domain: COOKIE_DOMAIN,
|
|
130
138
|
path: '/',
|
|
131
139
|
secure: true,
|
|
132
140
|
}).value = access_token
|
|
@@ -187,7 +195,9 @@ function toTariffs() {
|
|
|
187
195
|
}
|
|
188
196
|
|
|
189
197
|
onMounted(() => {
|
|
190
|
-
|
|
198
|
+
const options = { domain: COOKIE_DOMAIN }
|
|
199
|
+
|
|
200
|
+
rememberMe.value = !!useCookie('username', options).value && !!useCookie('password', options).value
|
|
191
201
|
})
|
|
192
202
|
|
|
193
203
|
function handleEnter(e: KeyboardEvent) {
|