@ozdao/prometheus-framework 0.2.90 → 0.2.91
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.server.js +1 -0
- package/dist/auth.server.mjs +1 -0
- package/dist/main-BQisDfLk.js +92 -0
- package/dist/main-DTlUA63C.mjs +13617 -0
- package/dist/main.css +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +94 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +1 -102
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +84 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +1 -84
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +17 -16
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +1 -103
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +103 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +1 -36
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +36 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +9 -8
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +28 -29
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +65 -65
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +38 -39
- package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/auth.js +35 -37
- package/dist/prometheus-framework/src/modules/auth/store/twofa.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/twofa.js +3 -3
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +12 -11
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -66
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +66 -0
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +4 -3
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +5 -4
- package/dist/prometheus-framework/src/modules/middlewares/client/inputs.validation.cjs +1 -1
- package/dist/prometheus-framework/src/modules/middlewares/client/inputs.validation.js +10 -13
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +5 -4
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +6 -5
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +9 -8
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +5 -4
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +5 -4
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-CXzcKdk4.mjs +54 -0
- package/dist/web-D9Cfcy5k.js +1 -0
- package/package.json +1 -1
- package/src/components/Button/Button.vue +5 -8
- package/src/components/FieldPhone/FieldPhone.vue +4 -0
- package/src/modules/auth/components/pages/ResetPassword.vue +1 -1
- package/src/modules/auth/components/pages/SignIn.vue +3 -3
- package/src/modules/auth/components/pages/SignUp.vue +1 -1
- package/src/modules/auth/controllers/auth.controller.js +1 -0
- package/src/modules/auth/store/auth.js +3 -5
- package/src/modules/auth/store/twofa.js +1 -1
- package/src/modules/middlewares/client/inputs.validation.js +0 -13
@@ -1,50 +1,50 @@
|
|
1
|
-
import { ref as
|
1
|
+
import { ref as m, onMounted as k, resolveComponent as E, openBlock as V, createElementBlock as I, createElementVNode as l, createTextVNode as c, toDisplayString as r, unref as s, createVNode as o, withCtx as d, Transition as b, withDirectives as g, vShow as w } from "vue";
|
2
2
|
import q from "../../../../components/Tab/Tab.vue2.js";
|
3
|
-
import y from "../../../../components/Field/Field.
|
3
|
+
import y from "../../../../components/Field/Field.vue.js";
|
4
4
|
import D from "../../../../components/FieldPhone/FieldPhone.vue.js";
|
5
|
-
import
|
6
|
-
import { useRoute as
|
7
|
-
import { useI18n as
|
8
|
-
import
|
9
|
-
import { state as
|
5
|
+
import O from "../../../../components/Button/Button.vue.js";
|
6
|
+
import { useRoute as j, useRouter as A } from "vue-router";
|
7
|
+
import { useI18n as F } from "vue-i18n";
|
8
|
+
import N from "../../localization/SignIn.json.js";
|
9
|
+
import { state as i, actions as T } from "../../store/auth.js";
|
10
10
|
import { validateInputs as S, validatePhone as B, validateEmail as R } from "../../../middlewares/client/inputs.validation.js";
|
11
11
|
import "./SignIn.vue2.js";
|
12
|
-
const $ = { class: "" }, L = /* @__PURE__ */
|
12
|
+
const $ = { class: "" }, L = /* @__PURE__ */ l("img", {
|
13
13
|
src: "/logo/logo.svg",
|
14
14
|
class: "i-extra radius-small mn-b-small"
|
15
|
-
}, null, -1), M = { class: "mn-b-medium" }, z = /* @__PURE__ */
|
15
|
+
}, null, -1), M = { class: "mn-b-medium" }, z = /* @__PURE__ */ l("br", null, null, -1), G = { class: "t-semi" }, H = { class: "mn-b-big" }, J = { class: "mn-b-small p-small uppercase t-semi bg-grey radius-big o-hidden" }, K = { class: "pos-relative" }, Q = { class: "mn-b-thin radius-small" }, W = { class: "mn-b-thin radius-small o-hidden" }, X = { class: "w-100 mn-b-big" }, ue = {
|
16
16
|
__name: "SignIn",
|
17
17
|
setup(Y) {
|
18
|
-
const h =
|
18
|
+
const h = m(null), x = m(null), f = m(null), _ = j(), v = A(), { t: a } = F({
|
19
19
|
useScope: "global",
|
20
|
-
...
|
21
|
-
}), n =
|
20
|
+
...N
|
21
|
+
}), n = m("phone"), C = (u) => new Promise((t, p) => {
|
22
22
|
const e = document.createElement("script");
|
23
|
-
e.type = "text/javascript", e.src =
|
23
|
+
e.type = "text/javascript", e.src = u, e.onload = t, e.onerror = p, document.head.appendChild(e);
|
24
24
|
});
|
25
25
|
k(async () => {
|
26
|
-
await
|
26
|
+
await C("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js");
|
27
27
|
});
|
28
|
-
async function
|
28
|
+
async function P() {
|
29
29
|
try {
|
30
30
|
n.value === "phone" && await S(
|
31
31
|
h,
|
32
32
|
B,
|
33
|
-
|
33
|
+
i.user.phone,
|
34
34
|
"Некорректный телефон"
|
35
35
|
), n.value === "email" && await S(
|
36
36
|
f,
|
37
37
|
R,
|
38
|
-
|
38
|
+
i.user.email,
|
39
39
|
"Некорректный email"
|
40
40
|
);
|
41
41
|
} catch {
|
42
42
|
throw new Error();
|
43
43
|
}
|
44
|
-
const
|
45
|
-
|
44
|
+
const u = { ...i.user };
|
45
|
+
await T.login(u, n.value);
|
46
46
|
}
|
47
|
-
function
|
47
|
+
function U() {
|
48
48
|
_.query.returnUrl ? v.push({
|
49
49
|
path: _.query.returnUrl,
|
50
50
|
query: {
|
@@ -53,73 +53,73 @@ const $ = { class: "" }, L = /* @__PURE__ */ a("img", {
|
|
53
53
|
}) : v.push({
|
54
54
|
name: "User Profile",
|
55
55
|
params: {
|
56
|
-
_id:
|
56
|
+
_id: i.user._id
|
57
57
|
},
|
58
58
|
query: {
|
59
59
|
afterAuth: "true"
|
60
60
|
}
|
61
61
|
});
|
62
62
|
}
|
63
|
-
return (
|
64
|
-
const
|
65
|
-
return
|
63
|
+
return (u, t) => {
|
64
|
+
const p = E("router-link");
|
65
|
+
return V(), I("section", $, [
|
66
66
|
L,
|
67
|
-
|
68
|
-
c(
|
67
|
+
l("h3", M, [
|
68
|
+
c(r(s(a)("title")) + " ", 1),
|
69
69
|
z,
|
70
|
-
|
70
|
+
l("span", G, r(s(a)("subtitle")), 1)
|
71
71
|
]),
|
72
|
-
|
73
|
-
|
72
|
+
l("p", H, [
|
73
|
+
o(p, {
|
74
74
|
to: { name: "Sign Up" },
|
75
75
|
class: "underline t-second"
|
76
76
|
}, {
|
77
|
-
default:
|
78
|
-
c(
|
77
|
+
default: d(() => [
|
78
|
+
c(r(s(a)("signup")), 1)
|
79
79
|
]),
|
80
80
|
_: 1
|
81
81
|
})
|
82
82
|
]),
|
83
|
-
|
84
|
-
|
83
|
+
l("div", J, [
|
84
|
+
o(q, {
|
85
85
|
selected: n.value,
|
86
86
|
"onUpdate:selected": t[0] || (t[0] = (e) => n.value = e),
|
87
87
|
tabs: [
|
88
|
-
{ name: s(
|
89
|
-
{ name: s(
|
88
|
+
{ name: s(a)("phone"), value: "phone" },
|
89
|
+
{ name: s(a)("email"), value: "email" }
|
90
90
|
]
|
91
91
|
}, null, 8, ["selected", "tabs"])
|
92
92
|
]),
|
93
|
-
|
94
|
-
|
95
|
-
default:
|
96
|
-
g(
|
97
|
-
|
98
|
-
|
99
|
-
"onUpdate:modelValue": t[1] || (t[1] = (e) => l.user.phone = e),
|
93
|
+
l("div", K, [
|
94
|
+
o(b, { name: "slide-fade" }, {
|
95
|
+
default: d(() => [
|
96
|
+
g(l("div", Q, [
|
97
|
+
o(D, {
|
98
|
+
onChange: t[1] || (t[1] = (e) => i.user.phone = e),
|
100
99
|
dropdownOptions: {
|
101
100
|
showDialCodeInSelection: !0,
|
102
101
|
showFlags: !0,
|
103
102
|
showDialCodeInList: !0
|
104
103
|
},
|
104
|
+
validCharactersOnly: !0,
|
105
105
|
validation: h.value,
|
106
106
|
mode: "national",
|
107
|
-
inputOptions: { placeholder: s(
|
107
|
+
inputOptions: { placeholder: s(a)("phonePlaceholder"), type: "tel" },
|
108
108
|
class: "bg-grey pd-small radius-small mn-b-thin"
|
109
|
-
}, null, 8, ["
|
109
|
+
}, null, 8, ["validation", "inputOptions"])
|
110
110
|
], 512), [
|
111
111
|
[w, n.value === "phone"]
|
112
112
|
])
|
113
113
|
]),
|
114
114
|
_: 1
|
115
115
|
}),
|
116
|
-
|
117
|
-
default:
|
118
|
-
g(
|
119
|
-
|
120
|
-
field:
|
121
|
-
"onUpdate:field": t[2] || (t[2] = (e) =>
|
122
|
-
placeholder: s(
|
116
|
+
o(b, { name: "slide-fade" }, {
|
117
|
+
default: d(() => [
|
118
|
+
g(l("div", W, [
|
119
|
+
o(y, {
|
120
|
+
field: i.user.email,
|
121
|
+
"onUpdate:field": t[2] || (t[2] = (e) => i.user.email = e),
|
122
|
+
placeholder: s(a)("emailPlaceholder"),
|
123
123
|
validation: f.value,
|
124
124
|
class: "bg-grey pd-medium radius-small"
|
125
125
|
}, null, 8, ["field", "placeholder", "validation"])
|
@@ -130,32 +130,32 @@ const $ = { class: "" }, L = /* @__PURE__ */ a("img", {
|
|
130
130
|
_: 1
|
131
131
|
})
|
132
132
|
]),
|
133
|
-
|
134
|
-
field:
|
135
|
-
"onUpdate:field": t[3] || (t[3] = (e) =>
|
133
|
+
o(y, {
|
134
|
+
field: i.user.password,
|
135
|
+
"onUpdate:field": t[3] || (t[3] = (e) => i.user.password = e),
|
136
136
|
type: "password",
|
137
|
-
validation:
|
138
|
-
placeholder: s(
|
137
|
+
validation: x.value,
|
138
|
+
placeholder: s(a)("passwordPlaceholder"),
|
139
139
|
class: "bg-grey pd-medium radius-small mn-b-semi"
|
140
140
|
}, null, 8, ["field", "validation", "placeholder"]),
|
141
|
-
|
142
|
-
|
141
|
+
l("div", X, [
|
142
|
+
o(p, {
|
143
143
|
to: "/auth/reset-password",
|
144
144
|
class: "underline d-block t-blue"
|
145
145
|
}, {
|
146
|
-
default:
|
147
|
-
c(
|
146
|
+
default: d(() => [
|
147
|
+
c(r(s(a)("forgotPassword")), 1)
|
148
148
|
]),
|
149
149
|
_: 1
|
150
150
|
})
|
151
151
|
]),
|
152
|
-
|
153
|
-
submit:
|
154
|
-
callback:
|
152
|
+
o(O, {
|
153
|
+
submit: P,
|
154
|
+
callback: U,
|
155
155
|
class: "w-100 bg-main mn-b-thin"
|
156
156
|
}, {
|
157
|
-
default:
|
158
|
-
c(
|
157
|
+
default: d(() => [
|
158
|
+
c(r(s(a)("signin")), 1)
|
159
159
|
]),
|
160
160
|
_: 1
|
161
161
|
})
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../../../../components/Tab/Tab.vue2.cjs"),f=require("../../../../components/Field/Field.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../../../../components/Tab/Tab.vue2.cjs"),f=require("../../../../components/Field/Field.vue.cjs"),_=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),b=require("../../../../components/Button/Button.vue.cjs"),d=require("vue-router"),g=require("vue-i18n"),w=require("../../localization/SignUp.json.cjs"),o=require("../../store/auth.cjs"),N=require("../../store/twofa.cjs"),s=require("../../../middlewares/client/inputs.validation.cjs");require("./SignUp.vue2.cjs");const V={class:"t-left pd-medium"},S={class:"mn-b-small"},E={class:"mn-b-small p-small uppercase t-semi bg-grey radius-big o-hidden"},q={class:"pos-relative"},y={class:"mn-b-semi radius-small"},C={class:"mn-b-small t-transp"},D={class:"mn-b-semi radius-small o-hidden"},x={class:"mn-b-small t-transp"},T={class:"w-100"},k={__name:"SignUp",setup(I){const{t}=g.useI18n({useScope:"global",...w.default}),i=e.ref(null),r=e.ref(null);d.useRoute();const c=d.useRouter(),a=e.ref("phone");async function m(){try{a.value==="phone"&&await s.validateInputs(i,s.validatePhone,o.state.user.phone,"Некорректный телефон"),a.value==="email"&&await s.validateInputs(r,s.validateEmail,o.state.user.email,"Некорректный email")}catch{throw new Error}try{await N.sendCode(o.state.user,"signup",a.value)}catch{throw new Error}}function p(){c.push({name:"Enter Code"})}return(u,n)=>{const h=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",V,[e.createElementVNode("h3",S,e.toDisplayString(e.unref(t)("title")),1),e.createElementVNode("div",E,[e.createVNode(v.default,{selected:a.value,"onUpdate:selected":n[0]||(n[0]=l=>a.value=l),tabs:[{name:e.unref(t)("phone"),value:"phone"},{name:e.unref(t)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",q,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",y,[e.createElementVNode("p",C,e.toDisplayString(e.unref(t)("smsNotice")),1),e.createVNode(_.default,{onChange:n[1]||(n[1]=l=>o.state.user.phone=l),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:i.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-b-thin"},null,8,["validation","inputOptions"])],512),[[e.vShow,a.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",D,[e.createElementVNode("p",x,e.toDisplayString(e.unref(t)("emailNotice")),1),e.createVNode(f.default,{field:o.state.user.email,"onUpdate:field":n[2]||(n[2]=l=>o.state.user.email=l),placeholder:e.unref(t)("emailPlaceholder"),validation:r.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,a.value==="email"]])]),_:1})]),e.createVNode(b.default,{submit:m,callback:p,class:"w-100 bg-main mn-b-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1}),e.createElementVNode("div",T,[e.createVNode(h,{to:"/auth/signin",class:"underline mn-b-medium d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("haveAccount")),1)]),_:1})])])}}};exports.default=k;
|
@@ -1,32 +1,32 @@
|
|
1
|
-
import { ref as d, resolveComponent as
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import D from "../../../../components/Button/Button.
|
1
|
+
import { ref as d, resolveComponent as k, openBlock as E, createElementBlock as S, createElementVNode as o, toDisplayString as r, unref as t, createVNode as l, Transition as h, withCtx as m, withDirectives as f, vShow as _, createTextVNode as v } from "vue";
|
2
|
+
import x from "../../../../components/Tab/Tab.vue2.js";
|
3
|
+
import N from "../../../../components/Field/Field.vue.js";
|
4
|
+
import V from "../../../../components/FieldPhone/FieldPhone.vue.js";
|
5
|
+
import D from "../../../../components/Button/Button.vue.js";
|
6
6
|
import { useRoute as I, useRouter as P } from "vue-router";
|
7
|
-
import { useI18n as
|
8
|
-
import
|
7
|
+
import { useI18n as F } from "vue-i18n";
|
8
|
+
import O from "../../localization/SignUp.json.js";
|
9
9
|
import { state as s } from "../../store/auth.js";
|
10
|
-
import { sendCode as
|
11
|
-
import { validateInputs as b, validatePhone as
|
10
|
+
import { sendCode as T } from "../../store/twofa.js";
|
11
|
+
import { validateInputs as b, validatePhone as U, validateEmail as A } from "../../../middlewares/client/inputs.validation.js";
|
12
12
|
import "./SignUp.vue2.js";
|
13
|
-
const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { class: "mn-b-small p-small uppercase t-semi bg-grey radius-big o-hidden" }, L = { class: "pos-relative" }, j = { class: "mn-b-semi radius-small" }, q = { class: "mn-b-small t-transp" }, z = { class: "mn-b-semi radius-small o-hidden" }, G = { class: "mn-b-small t-transp" }, H = { class: "w-100" },
|
13
|
+
const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { class: "mn-b-small p-small uppercase t-semi bg-grey radius-big o-hidden" }, L = { class: "pos-relative" }, j = { class: "mn-b-semi radius-small" }, q = { class: "mn-b-small t-transp" }, z = { class: "mn-b-semi radius-small o-hidden" }, G = { class: "mn-b-small t-transp" }, H = { class: "w-100" }, ie = {
|
14
14
|
__name: "SignUp",
|
15
15
|
setup(J) {
|
16
|
-
const { t: e } =
|
16
|
+
const { t: e } = F({
|
17
17
|
useScope: "global",
|
18
|
-
...
|
18
|
+
...O
|
19
19
|
}), u = d(null), c = d(null);
|
20
20
|
I();
|
21
|
-
const
|
22
|
-
async function
|
21
|
+
const g = P(), a = d("phone");
|
22
|
+
async function w() {
|
23
23
|
try {
|
24
|
-
|
24
|
+
a.value === "phone" && await b(
|
25
25
|
u,
|
26
|
-
|
26
|
+
U,
|
27
27
|
s.user.phone,
|
28
28
|
"Некорректный телефон"
|
29
|
-
),
|
29
|
+
), a.value === "email" && await b(
|
30
30
|
c,
|
31
31
|
A,
|
32
32
|
s.user.email,
|
@@ -36,22 +36,22 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
|
|
36
36
|
throw new Error();
|
37
37
|
}
|
38
38
|
try {
|
39
|
-
await
|
39
|
+
await T(s.user, "signup", a.value);
|
40
40
|
} catch {
|
41
41
|
throw new Error();
|
42
42
|
}
|
43
43
|
}
|
44
|
-
function
|
45
|
-
|
44
|
+
function C() {
|
45
|
+
g.push({ name: "Enter Code" });
|
46
46
|
}
|
47
47
|
return (p, i) => {
|
48
|
-
const y =
|
49
|
-
return
|
48
|
+
const y = k("router-link");
|
49
|
+
return E(), S("section", B, [
|
50
50
|
o("h3", R, r(t(e)("title")), 1),
|
51
51
|
o("div", $, [
|
52
|
-
|
53
|
-
selected:
|
54
|
-
"onUpdate:selected": i[0] || (i[0] = (n) =>
|
52
|
+
l(x, {
|
53
|
+
selected: a.value,
|
54
|
+
"onUpdate:selected": i[0] || (i[0] = (n) => a.value = n),
|
55
55
|
tabs: [
|
56
56
|
{ name: t(e)("phone"), value: "phone" },
|
57
57
|
{ name: t(e)("email"), value: "email" }
|
@@ -59,13 +59,12 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
|
|
59
59
|
}, null, 8, ["selected", "tabs"])
|
60
60
|
]),
|
61
61
|
o("div", L, [
|
62
|
-
|
62
|
+
l(h, { name: "slide-fade" }, {
|
63
63
|
default: m(() => [
|
64
64
|
f(o("div", j, [
|
65
65
|
o("p", q, r(t(e)("smsNotice")), 1),
|
66
|
-
|
67
|
-
|
68
|
-
"onUpdate:modelValue": i[1] || (i[1] = (n) => s.user.phone = n),
|
66
|
+
l(V, {
|
67
|
+
onChange: i[1] || (i[1] = (n) => s.user.phone = n),
|
69
68
|
dropdownOptions: {
|
70
69
|
showDialCodeInSelection: !0,
|
71
70
|
showFlags: !0,
|
@@ -75,18 +74,18 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
|
|
75
74
|
mode: "national",
|
76
75
|
inputOptions: { placeholder: t(e)("phonePlaceholder") },
|
77
76
|
class: "bg-grey pd-small radius-small mn-b-thin"
|
78
|
-
}, null, 8, ["
|
77
|
+
}, null, 8, ["validation", "inputOptions"])
|
79
78
|
], 512), [
|
80
|
-
[_,
|
79
|
+
[_, a.value === "phone"]
|
81
80
|
])
|
82
81
|
]),
|
83
82
|
_: 1
|
84
83
|
}),
|
85
|
-
|
84
|
+
l(h, { name: "slide-fade" }, {
|
86
85
|
default: m(() => [
|
87
86
|
f(o("div", z, [
|
88
87
|
o("p", G, r(t(e)("emailNotice")), 1),
|
89
|
-
|
88
|
+
l(N, {
|
90
89
|
field: s.user.email,
|
91
90
|
"onUpdate:field": i[2] || (i[2] = (n) => s.user.email = n),
|
92
91
|
placeholder: t(e)("emailPlaceholder"),
|
@@ -94,15 +93,15 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
|
|
94
93
|
class: "bg-grey pd-medium radius-small"
|
95
94
|
}, null, 8, ["field", "placeholder", "validation"])
|
96
95
|
], 512), [
|
97
|
-
[_,
|
96
|
+
[_, a.value === "email"]
|
98
97
|
])
|
99
98
|
]),
|
100
99
|
_: 1
|
101
100
|
})
|
102
101
|
]),
|
103
|
-
|
104
|
-
submit:
|
105
|
-
callback:
|
102
|
+
l(D, {
|
103
|
+
submit: w,
|
104
|
+
callback: C,
|
106
105
|
class: "w-100 bg-main mn-b-big"
|
107
106
|
}, {
|
108
107
|
default: m(() => [
|
@@ -111,7 +110,7 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
|
|
111
110
|
_: 1
|
112
111
|
}),
|
113
112
|
o("div", H, [
|
114
|
-
|
113
|
+
l(y, {
|
115
114
|
to: "/auth/signin",
|
116
115
|
class: "underline mn-b-medium d-block t-blue"
|
117
116
|
}, {
|
@@ -126,5 +125,5 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
|
|
126
125
|
}
|
127
126
|
};
|
128
127
|
export {
|
129
|
-
|
128
|
+
ie as default
|
130
129
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../../node_modules/axios/lib/axios.cjs"),d=require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs"),l=require("../../../../node_modules/@capacitor/preferences/dist/esm/index.cjs"),w=require("vue"),c=require("../../globals/store/globals.cjs"),g=require("./twofa.cjs"),i=f.default.create({baseURL:process.env.API_URL,withCredentials:!0}),o=w.reactive({user:{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1}});async function O(){const e=await P("user");if(e){const{_id:t,email:s,phone:n,roles:a,accessToken:r}=e;Object.assign(o.user,{_id:t,email:s,phone:n}),Object.assign(o.access,{token:r,roles:a,status:!!r}),i.interceptors.request.use(u=>(r&&(u.headers["x-access-token"]=r),u),u=>Promise.reject(u))}}O();const k={async login(e,t){try{const s=await i.post("/api/auth/signin",{...e,type:t});return p("user",s.data),Object.assign(o.user,{...s.data}),Object.assign(o.access,{token:s.data.accessToken,status:!0,roles:s.data.roles}),s.data}catch(s){return Object.assign(o.access,{token:null,status:!1,roles:null}),c.setError(s),Promise.reject(s)}},async signup(e,t,s){const{password:n,passwordRepeat:a}=o.user;if(console.log(n),console.log(a),n!==a){const r={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(r),new Error(r.response.status)}try{const r=await i.post("/api/auth/signup",{...e,type:t,inviteCode:s});return console.log(r),r.data.accessToken&&p("user",r.data),Object.assign(o.user,{...r.data}),Object.assign(o.access,{token:r.data.accessToken,status:!0,roles:r.data.roles}),r.data}catch(r){throw c.setError(r),console.log("Sign up falied"),r}},logout(){j("user"),Object.assign(o.user,{email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(o.access,{token:null,status:!1})},async resetPassword(e,t){try{const s=await i.post("/api/auth/reset-password",{email:e.email,phone:e.phone,type:t});return Object.assign(g.state.code,{...s.data,isSended:!0}),s.data}catch(s){return c.setError(s),Promise.reject(s)}},async updatePassword(e,t){const{password:s,passwordRepeat:n}=o.user;if(s!==n){const a={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(a),new Error(a.response.status)}try{const a=await i.post("/api/auth/update-password",{email:e.email,phone:e.phone,password:e.password,passwordRepeat:e.passwordRepeat,type:t});return a.data.accessToken&&p("user",a.data),Object.assign(o.user,{...a.data}),Object.assign(o.access,{token:a.data.accessToken,status:!0}),a.data}catch(a){return c.setError(a),Promise.reject(a)}}},h={development:{secure:!1,expires:7,sameSite:"Lax"},production:{expires:7,path:"/",domain:process.env.API_URL,sameSite:"none",secure:!0}};async function P(e){if(process.env.MOBILE_APP){const{value:t}=await l.Preferences.get({key:e});return t?JSON.parse(t):null}else{const t=d.default.get(e);return t?JSON.parse(t):null}}function p(e,t,s=process.env.DOMAIN_URL){process.env.MOBILE_APP?l.Preferences.set({key:e,value:JSON.stringify(t)}):d.default.set(e,JSON.stringify(t),h[s])}function j(e,t=process.env.NODE_ENV){if(process.env.MOBILE_APP)l.Preferences.remove({key:e});else{const s=t==="production"?{domain:process.env.API_URL}:{};d.default.remove(e,s)}}w.watch(o,(e,t)=>{});exports.actions=k;exports.state=o;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import
|
1
|
+
import w from "../../../../node_modules/axios/lib/axios.js";
|
2
2
|
import d from "../../../../../node_modules/js-cookie/dist/js.cookie.js";
|
3
3
|
import { Preferences as l } from "../../../../node_modules/@capacitor/preferences/dist/esm/index.js";
|
4
|
-
import { reactive as
|
5
|
-
import { setError as
|
4
|
+
import { reactive as m, watch as f } from "vue";
|
5
|
+
import { setError as c } from "../../globals/store/globals.js";
|
6
6
|
import { state as O } from "./twofa.js";
|
7
|
-
const
|
7
|
+
const i = w.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = m({
|
8
8
|
user: {
|
9
9
|
_id: void 0,
|
10
10
|
username: "",
|
@@ -22,15 +22,15 @@ const p = m.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = w
|
|
22
22
|
async function g() {
|
23
23
|
const e = await k("user");
|
24
24
|
if (e) {
|
25
|
-
const { _id: t, email: s, phone:
|
26
|
-
Object.assign(r.user, { _id: t, email: s, phone:
|
25
|
+
const { _id: t, email: s, phone: n, roles: o, accessToken: a } = e;
|
26
|
+
Object.assign(r.user, { _id: t, email: s, phone: n }), Object.assign(r.access, { token: a, roles: o, status: !!a }), i.interceptors.request.use((p) => (a && (p.headers["x-access-token"] = a), p), (p) => Promise.reject(p));
|
27
27
|
}
|
28
28
|
}
|
29
29
|
g();
|
30
30
|
const R = {
|
31
31
|
async login(e, t) {
|
32
32
|
try {
|
33
|
-
const s = await
|
33
|
+
const s = await i.post("/api/auth/signin", {
|
34
34
|
...e,
|
35
35
|
type: t
|
36
36
|
});
|
@@ -46,36 +46,34 @@ const R = {
|
|
46
46
|
token: null,
|
47
47
|
status: !1,
|
48
48
|
roles: null
|
49
|
-
}),
|
49
|
+
}), c(s), Promise.reject(s);
|
50
50
|
}
|
51
51
|
},
|
52
52
|
async signup(e, t, s) {
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
const o = {
|
53
|
+
const { password: n, passwordRepeat: o } = r.user;
|
54
|
+
if (console.log(n), console.log(o), n !== o) {
|
55
|
+
const a = {
|
57
56
|
response: {
|
58
57
|
data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
|
59
58
|
}
|
60
59
|
};
|
61
|
-
throw
|
60
|
+
throw c(a), new Error(a.response.status);
|
62
61
|
}
|
63
62
|
try {
|
64
|
-
|
65
|
-
const o = await p.post("/api/auth/signup", {
|
63
|
+
const a = await i.post("/api/auth/signup", {
|
66
64
|
...e,
|
67
65
|
type: t,
|
68
66
|
inviteCode: s
|
69
67
|
});
|
70
|
-
return console.log(
|
71
|
-
...
|
68
|
+
return console.log(a), a.data.accessToken && u("user", a.data), Object.assign(r.user, {
|
69
|
+
...a.data
|
72
70
|
}), Object.assign(r.access, {
|
73
|
-
token:
|
71
|
+
token: a.data.accessToken,
|
74
72
|
status: !0,
|
75
|
-
roles:
|
76
|
-
}),
|
77
|
-
} catch (
|
78
|
-
throw
|
73
|
+
roles: a.data.roles
|
74
|
+
}), a.data;
|
75
|
+
} catch (a) {
|
76
|
+
throw c(a), console.log("Sign up falied"), a;
|
79
77
|
}
|
80
78
|
},
|
81
79
|
logout() {
|
@@ -91,9 +89,9 @@ const R = {
|
|
91
89
|
},
|
92
90
|
async resetPassword(e, t) {
|
93
91
|
try {
|
94
|
-
const s = await
|
92
|
+
const s = await i.post("/api/auth/reset-password", {
|
95
93
|
email: e.email,
|
96
|
-
phone: e.phone
|
94
|
+
phone: e.phone,
|
97
95
|
type: t
|
98
96
|
});
|
99
97
|
return Object.assign(O.code, {
|
@@ -101,35 +99,35 @@ const R = {
|
|
101
99
|
isSended: !0
|
102
100
|
}), s.data;
|
103
101
|
} catch (s) {
|
104
|
-
return
|
102
|
+
return c(s), Promise.reject(s);
|
105
103
|
}
|
106
104
|
},
|
107
105
|
async updatePassword(e, t) {
|
108
|
-
const { password: s, passwordRepeat:
|
109
|
-
if (s !==
|
110
|
-
const
|
106
|
+
const { password: s, passwordRepeat: n } = r.user;
|
107
|
+
if (s !== n) {
|
108
|
+
const o = {
|
111
109
|
response: {
|
112
110
|
data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
|
113
111
|
}
|
114
112
|
};
|
115
|
-
throw
|
113
|
+
throw c(o), new Error(o.response.status);
|
116
114
|
}
|
117
115
|
try {
|
118
|
-
const
|
116
|
+
const o = await i.post("/api/auth/update-password", {
|
119
117
|
email: e.email,
|
120
|
-
phone: e.phone
|
118
|
+
phone: e.phone,
|
121
119
|
password: e.password,
|
122
120
|
passwordRepeat: e.passwordRepeat,
|
123
121
|
type: t
|
124
122
|
});
|
125
|
-
return
|
126
|
-
...
|
123
|
+
return o.data.accessToken && u("user", o.data), Object.assign(r.user, {
|
124
|
+
...o.data
|
127
125
|
}), Object.assign(r.access, {
|
128
|
-
token:
|
126
|
+
token: o.data.accessToken,
|
129
127
|
status: !0
|
130
|
-
}),
|
131
|
-
} catch (
|
132
|
-
return
|
128
|
+
}), o.data;
|
129
|
+
} catch (o) {
|
130
|
+
return c(o), Promise.reject(o);
|
133
131
|
}
|
134
132
|
}
|
135
133
|
}, h = {
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../../../../node_modules/axios/lib/axios.cjs");require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs");const i=require("vue"),n=require("../../globals/store/globals.cjs"),c=d.default.create({baseURL:process.env.API_URL,withCredentials:!0}),t=i.reactive({code:{value:"",type:"",method:"",isSended:!1,isValid:!1}});async function l(a,o,r){let s="/api/twofa/sendcode";return o==="reset-password"&&(s="/api/twofa/sendcodereset"),await c.post(s,{phone:a.phone,email:a.email,method:o,type:r}).then(e=>(t.code=e.data,t.code.isSended=!0,Promise.resolve(e.data)),e=>(console.log(e),n.setError(e),Promise.reject(e)))}i.watch(t,(a,o)=>{});exports.sendCode=l;exports.state=t;
|
@@ -11,10 +11,10 @@ const p = r.create({ baseURL: process.env.API_URL, withCredentials: !0 }), a = d
|
|
11
11
|
isValid: !1
|
12
12
|
}
|
13
13
|
});
|
14
|
-
async function
|
14
|
+
async function h(t, o, i) {
|
15
15
|
let s = "/api/twofa/sendcode";
|
16
16
|
return o === "reset-password" && (s = "/api/twofa/sendcodereset"), await p.post(s, {
|
17
|
-
phone: t.phone
|
17
|
+
phone: t.phone,
|
18
18
|
email: t.email,
|
19
19
|
method: o,
|
20
20
|
type: i
|
@@ -26,6 +26,6 @@ async function w(t, o, i) {
|
|
26
26
|
n(a, (t, o) => {
|
27
27
|
});
|
28
28
|
export {
|
29
|
-
|
29
|
+
h as sendCode,
|
30
30
|
a as state
|
31
31
|
};
|
package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("vue-router"),f=require("../../../../components/Select/Select.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("vue-router"),f=require("../../../../components/Select/Select.vue2.cjs"),g=require("../../../../components/Feed/Feed.vue.cjs"),h=require("../../../organizations/components/blocks/CardOrganization.vue.cjs"),x=require("../../../icons/entities/IconFeatured.vue.cjs"),b=require("../../../icons/entities/IconPopular.vue.cjs"),_=require("../../../icons/entities/IconRecent.vue.cjs"),w=require("../../../icons/entities/IconFollowing.vue.cjs"),m=require("../../store/blogposts.cjs"),l=require("../../../auth/store/auth.cjs"),c=require("../../../organizations/store/organizations.cjs"),k=require("../../../organizations/store/memberships.cjs"),N={style:{"grid-template-columns":"2fr 4fr 2fr"},class:"cols-3 gap-thin pd-thin"},V={class:"align-self-start pos-sticky pos-t-0 w-100 bg-grey radius-big pd-medium p-medium gap-thin flex-column flex-nowrap flex"},v={class:"pos-relative"},C={class:"bg-main t-black radius-big pd-medium pos-relative mn-b-thin flex-v-center t-left flex-nowrap flex"},y={class:"pos-relative flex-v-center flex-nowrap flex"},B=e.createElementVNode("span",{class:"mn-r-small"},"Topics for ",-1),q={class:"align-self-start bg-grey radius-big pd-medium"},E={class:"gap-thin flex-nowrap flex"},z=e.createElementVNode("p",{class:"t-medium mn-b-small"},"Popular Communities",-1),T={__name:"Community",setup(F){const o=d.useRoute(),a=d.useRouter(),p=({membership:u,status:r,target:s},i,t)=>{k.mutations.handleMembershipUpdate(c.state.current,u,r,s,i,t)};return(u,r)=>{const s=e.resolveComponent("router-link"),i=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("ul",V,[e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="featured"},"cursor-pointer flex-v-center flex t-medium pd-thin radius-extra"]),onClick:r[0]||(r[0]=t=>e.unref(a).push({name:"Blog",params:{category:"featured"}}))},[e.createVNode(x.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Featured ")],2),e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="popular"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:r[1]||(r[1]=t=>e.unref(a).push({name:"Blog",params:{category:"popular"}}))},[e.createVNode(b.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Popular ")],2),e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="new"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:r[2]||(r[2]=t=>e.unref(a).push({name:"Blog",params:{category:"new"}}))},[e.createVNode(_.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Recent ")],2),l.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-white bg-black":e.unref(o).params.category==="following"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:r[3]||(r[3]=t=>e.unref(a).push({name:"Blog",params:{category:"following"}}))},[e.createVNode(w.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Following ")],2)):e.createCommentVNode("",!0),e.createVNode(s,{to:{name:"Create BlogPost"},class:"button t-medium mn-t-small bg-main w-100"},{default:e.withCtx(()=>[e.createTextVNode(" Create Post ")]),_:1})]),e.createElementVNode("section",v,[e.createElementVNode("header",C,[e.createElementVNode("h2",y,[B,e.createVNode(f.default,{options:["today","week","month","year"],select:m.state.filter.period,"onUpdate:select":r[4]||(r[4]=t=>m.state.filter.period=t),placeholder:"Select type",class:"t-semi pos-relative w-max bg-main t-black pd-thin radius-medium h2 t-center br-solid br-2px br-black-transp-10"},null,8,["select"])])]),e.createVNode(i,null,{default:e.withCtx(({Component:t,route:n})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t),{ref:"page",key:n.query}))]),_:2},1024)]),_:1})]),e.createElementVNode("div",q,[e.createElementVNode("div",E,[z,l.state.user._id?(e.openBlock(),e.createBlock(s,{key:0,to:{name:"Create Organization"},class:"t-medium cursor-pointer hover-scale-1 radius-extra flex-center flex i-medium bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" + ")]),_:1})):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.createVNode(g.default,{states:{empty:{title:"No Organization Found",description:"Currently, there are no organization available."}},store:{read:t=>c.actions.read(t),state:c.state},options:{user:l.state.user._id,sort:"numberOfMemberships",contain:["blogposts"],limit:10}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,n=>(e.openBlock(),e.createBlock(h.default,{key:n._id,organization:n,user:l.state.user,showProducts:!1,showRating:!1,showFeatured:!1,showFollowers:!1,onUpdateMembership:p,class:"mn-b-thin w-100 pd-0 bg-white radius-big o-hidden"},null,8,["organization","user"]))),128))]),_:1},8,["store","options"])]),_:1})])])}}};exports.default=T;
|