@duxweb/dvha-core 1.0.23 → 1.0.24
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/cjs/components/auth/can.cjs +1 -1
- package/dist/cjs/components/loader/iframe.cjs +1 -1
- package/dist/cjs/components/loader/remote/loader.cjs +1 -1
- package/dist/cjs/components/loader/remote/render.cjs +1 -1
- package/dist/cjs/components/overlay/overlay.cjs +1 -1
- package/dist/cjs/components/status/exception.cjs +1 -1
- package/dist/cjs/directive/permission.cjs +1 -1
- package/dist/cjs/hooks/auth.cjs +1 -1
- package/dist/cjs/hooks/data.cjs +1 -1
- package/dist/cjs/hooks/export.cjs +1 -1
- package/dist/cjs/hooks/exportCsv.cjs +2 -2
- package/dist/cjs/hooks/form.cjs +1 -1
- package/dist/cjs/hooks/formExtend.cjs +1 -1
- package/dist/cjs/hooks/i18n.cjs +1 -1
- package/dist/cjs/hooks/import.cjs +1 -1
- package/dist/cjs/hooks/importCsv.cjs +2 -2
- package/dist/cjs/hooks/json/utils/expressionParser.cjs +1 -1
- package/dist/cjs/hooks/json/vFor.cjs +1 -1
- package/dist/cjs/hooks/json/vOn.cjs +1 -1
- package/dist/cjs/hooks/json/vShow.cjs +1 -1
- package/dist/cjs/hooks/json.cjs +1 -1
- package/dist/cjs/hooks/list.cjs +1 -1
- package/dist/cjs/hooks/manage.cjs +1 -1
- package/dist/cjs/hooks/menu.cjs +1 -1
- package/dist/cjs/hooks/select.cjs +1 -1
- package/dist/cjs/hooks/theme.cjs +3 -3
- package/dist/cjs/hooks/tree.cjs +1 -1
- package/dist/cjs/hooks/upload/s3.cjs +1 -1
- package/dist/cjs/hooks/upload.cjs +1 -1
- package/dist/cjs/preset/authProvider.cjs +1 -1
- package/dist/cjs/preset/dataProvider.cjs +1 -1
- package/dist/cjs/preset/i18nProvider.cjs +1 -1
- package/dist/cjs/provider/app.cjs +1 -1
- package/dist/cjs/router/route.cjs +1 -1
- package/dist/cjs/stores/auth.cjs +1 -1
- package/dist/cjs/stores/i18n.cjs +1 -1
- package/dist/cjs/stores/jsonSchema.cjs +1 -1
- package/dist/cjs/stores/manage.cjs +1 -1
- package/dist/cjs/stores/route.cjs +1 -1
- package/dist/cjs/stores/tab.cjs +1 -1
- package/dist/cjs/stores/theme.cjs +1 -1
- package/dist/cjs/utils/tree.cjs +1 -1
- package/dist/esm/components/auth/can.js +8 -11
- package/dist/esm/components/loader/iframe.js +14 -17
- package/dist/esm/components/loader/remote/loader.js +103 -105
- package/dist/esm/components/loader/remote/render.js +10 -11
- package/dist/esm/components/overlay/overlay.js +7 -7
- package/dist/esm/components/status/exception.js +10 -13
- package/dist/esm/directive/permission.js +6 -7
- package/dist/esm/hooks/auth.js +73 -83
- package/dist/esm/hooks/data.js +290 -345
- package/dist/esm/hooks/export.js +16 -17
- package/dist/esm/hooks/exportCsv.js +26 -27
- package/dist/esm/hooks/form.js +49 -54
- package/dist/esm/hooks/formExtend.js +24 -25
- package/dist/esm/hooks/i18n.js +11 -29
- package/dist/esm/hooks/import.js +31 -32
- package/dist/esm/hooks/importCsv.js +24 -25
- package/dist/esm/hooks/json/utils/expressionParser.js +36 -42
- package/dist/esm/hooks/json/vFor.js +15 -16
- package/dist/esm/hooks/json/vOn.js +17 -18
- package/dist/esm/hooks/json/vShow.js +9 -10
- package/dist/esm/hooks/json.js +88 -94
- package/dist/esm/hooks/list.js +100 -127
- package/dist/esm/hooks/manage.js +13 -17
- package/dist/esm/hooks/menu.js +39 -52
- package/dist/esm/hooks/select.js +35 -40
- package/dist/esm/hooks/theme.js +127 -141
- package/dist/esm/hooks/tree.js +22 -28
- package/dist/esm/hooks/upload/s3.js +22 -23
- package/dist/esm/hooks/upload.js +152 -159
- package/dist/esm/preset/authProvider.js +63 -117
- package/dist/esm/preset/dataProvider.js +69 -76
- package/dist/esm/preset/i18nProvider.js +18 -18
- package/dist/esm/provider/app.js +74 -81
- package/dist/esm/router/route.js +16 -24
- package/dist/esm/stores/auth.js +17 -20
- package/dist/esm/stores/i18n.js +10 -10
- package/dist/esm/stores/jsonSchema.js +20 -23
- package/dist/esm/stores/manage.js +33 -33
- package/dist/esm/stores/route.js +38 -50
- package/dist/esm/stores/tab.js +38 -54
- package/dist/esm/stores/theme.js +28 -29
- package/dist/esm/utils/tree.js +23 -24
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCan as
|
|
1
|
+
import { useCan as i } from "../hooks/auth.js";
|
|
2
2
|
import "vue";
|
|
3
3
|
import "@tanstack/vue-query";
|
|
4
4
|
import "lodash-es";
|
|
@@ -14,15 +14,14 @@ import "@overlastic/vue";
|
|
|
14
14
|
import "clsx";
|
|
15
15
|
import "colorizr";
|
|
16
16
|
import "axios";
|
|
17
|
-
const
|
|
18
|
-
mounted(t,
|
|
19
|
-
|
|
20
|
-
const { value: o } = i;
|
|
17
|
+
const b = {
|
|
18
|
+
mounted(t, r) {
|
|
19
|
+
const { value: o } = r;
|
|
21
20
|
if (!o)
|
|
22
21
|
return;
|
|
23
|
-
|
|
22
|
+
i()(o) || t.parentElement?.removeChild(t);
|
|
24
23
|
}
|
|
25
24
|
};
|
|
26
25
|
export {
|
|
27
|
-
|
|
26
|
+
b as permissionDirective
|
|
28
27
|
};
|
package/dist/esm/hooks/auth.js
CHANGED
|
@@ -1,137 +1,127 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { useAuthStore as
|
|
4
|
-
import { useManage as
|
|
5
|
-
function
|
|
6
|
-
const
|
|
1
|
+
import { ref as d } from "vue";
|
|
2
|
+
import { useRouter as g } from "vue-router";
|
|
3
|
+
import { useAuthStore as c } from "../stores/auth.js";
|
|
4
|
+
import { useManage as i } from "./manage.js";
|
|
5
|
+
function w(e) {
|
|
6
|
+
const t = i(), n = c(), u = g(), s = d(!1);
|
|
7
7
|
return {
|
|
8
|
-
mutate: async (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (!(n != null && n.data))
|
|
8
|
+
mutate: async (o) => {
|
|
9
|
+
s.value = !0;
|
|
10
|
+
const a = await t.config.authProvider?.login(o, t);
|
|
11
|
+
if (s.value = !1, a?.success) {
|
|
12
|
+
if (!a?.data)
|
|
14
13
|
throw new Error("Login response data is undefined");
|
|
15
|
-
(
|
|
14
|
+
e?.onSuccess?.(a), n.login(a.data), u.push(t.getRoutePath(a.redirectTo || "/"));
|
|
16
15
|
return;
|
|
17
16
|
}
|
|
18
|
-
|
|
17
|
+
e?.onError?.(a);
|
|
19
18
|
},
|
|
20
|
-
isLoading:
|
|
19
|
+
isLoading: s
|
|
21
20
|
};
|
|
22
21
|
}
|
|
23
|
-
function
|
|
24
|
-
const
|
|
22
|
+
function P(e) {
|
|
23
|
+
const t = i(), n = c(), u = g();
|
|
25
24
|
return {
|
|
26
|
-
mutate: async (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
(c = t == null ? void 0 : t.onSuccess) == null || c.call(t, e), o.logout(), await r.replace(a.getRoutePath(e.redirectTo || "/login")), setTimeout(() => {
|
|
25
|
+
mutate: async (r) => {
|
|
26
|
+
const o = await t.config.authProvider?.logout(r, t);
|
|
27
|
+
if (o?.success) {
|
|
28
|
+
e?.onSuccess?.(o), n.logout(), await u.replace(t.getRoutePath(o.redirectTo || "/login")), setTimeout(() => {
|
|
31
29
|
window.location.reload();
|
|
32
30
|
}, 100);
|
|
33
31
|
return;
|
|
34
32
|
}
|
|
35
|
-
|
|
33
|
+
e?.onError?.(o);
|
|
36
34
|
}
|
|
37
35
|
};
|
|
38
36
|
}
|
|
39
|
-
function
|
|
40
|
-
const
|
|
37
|
+
function S(e) {
|
|
38
|
+
const t = i(), n = c(), u = g();
|
|
41
39
|
return {
|
|
42
|
-
mutate: async (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if ((i = t == null ? void 0 : t.onSuccess) == null || i.call(t, e), !(e != null && e.data))
|
|
40
|
+
mutate: async (r) => {
|
|
41
|
+
const o = await t.config.authProvider?.check?.(r, t, n.getUser());
|
|
42
|
+
if (o?.success) {
|
|
43
|
+
if (e?.onSuccess?.(o), !o?.data)
|
|
47
44
|
throw new Error("Check response data is undefined");
|
|
48
|
-
|
|
45
|
+
n.update(o.data);
|
|
49
46
|
return;
|
|
50
47
|
}
|
|
51
|
-
|
|
48
|
+
e?.onError?.(o), o?.logout && (await u.replace(t.getRoutePath(o.redirectTo || "/login")), setTimeout(() => {
|
|
52
49
|
window.location.reload();
|
|
53
50
|
}, 100));
|
|
54
51
|
}
|
|
55
52
|
};
|
|
56
53
|
}
|
|
57
|
-
function
|
|
58
|
-
const
|
|
54
|
+
function T(e) {
|
|
55
|
+
const t = i(), n = c(), u = g();
|
|
59
56
|
return {
|
|
60
|
-
mutate: async (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if ((i = t == null ? void 0 : t.onSuccess) == null || i.call(t, e), !(e != null && e.data))
|
|
57
|
+
mutate: async (r) => {
|
|
58
|
+
const o = await t.config.authProvider?.register?.(r, t);
|
|
59
|
+
if (o?.success) {
|
|
60
|
+
if (e?.onSuccess?.(o), !o?.data)
|
|
65
61
|
throw new Error("Register response data is undefined");
|
|
66
|
-
|
|
62
|
+
n.login(o.data), u.push(t.getRoutePath(o.redirectTo || "/"));
|
|
67
63
|
return;
|
|
68
64
|
}
|
|
69
|
-
|
|
65
|
+
e?.onError?.(o);
|
|
70
66
|
}
|
|
71
67
|
};
|
|
72
68
|
}
|
|
73
|
-
function
|
|
74
|
-
const
|
|
69
|
+
function v(e) {
|
|
70
|
+
const t = i(), n = g();
|
|
75
71
|
return {
|
|
76
|
-
mutate: async (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
(c = t == null ? void 0 : t.onSuccess) == null || c.call(t, u), u.redirectTo && o.push(a.getRoutePath(u.redirectTo || "/"));
|
|
72
|
+
mutate: async (s) => {
|
|
73
|
+
const r = await t.config.authProvider?.forgotPassword?.(s, t);
|
|
74
|
+
if (r?.success) {
|
|
75
|
+
e?.onSuccess?.(r), r.redirectTo && n.push(t.getRoutePath(r.redirectTo || "/"));
|
|
81
76
|
return;
|
|
82
77
|
}
|
|
83
|
-
|
|
78
|
+
e?.onError?.(r);
|
|
84
79
|
}
|
|
85
80
|
};
|
|
86
81
|
}
|
|
87
|
-
function
|
|
88
|
-
const
|
|
82
|
+
function E(e) {
|
|
83
|
+
const t = i(), n = g();
|
|
89
84
|
return {
|
|
90
|
-
mutate: async (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
(c = t == null ? void 0 : t.onSuccess) == null || c.call(t, u), u.redirectTo && o.push(a.getRoutePath(u.redirectTo || "/"));
|
|
85
|
+
mutate: async (s) => {
|
|
86
|
+
const r = await t.config.authProvider?.updatePassword?.(s, t);
|
|
87
|
+
if (r?.success) {
|
|
88
|
+
e?.onSuccess?.(r), r.redirectTo && n.push(t.getRoutePath(r.redirectTo || "/"));
|
|
95
89
|
return;
|
|
96
90
|
}
|
|
97
|
-
|
|
91
|
+
e?.onError?.(r);
|
|
98
92
|
}
|
|
99
93
|
};
|
|
100
94
|
}
|
|
101
|
-
function
|
|
102
|
-
const { config:
|
|
95
|
+
function R(e) {
|
|
96
|
+
const { config: t, getRoutePath: n } = i(), u = g(), s = c();
|
|
103
97
|
return {
|
|
104
|
-
mutate: async (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
t == null || t(n), n != null && n.logout && (g.logout(), await r.replace(o(n.redirectTo || "/login")), setTimeout(() => {
|
|
98
|
+
mutate: async (o) => {
|
|
99
|
+
const a = await t.authProvider?.onError(o);
|
|
100
|
+
e?.(a), a?.logout && (s.logout(), await u.replace(n(a.redirectTo || "/login")), setTimeout(() => {
|
|
108
101
|
window.location.reload();
|
|
109
102
|
}, 100));
|
|
110
103
|
}
|
|
111
104
|
};
|
|
112
105
|
}
|
|
113
|
-
function
|
|
114
|
-
return
|
|
106
|
+
function y(e) {
|
|
107
|
+
return c(e).getUser();
|
|
115
108
|
}
|
|
116
|
-
function
|
|
117
|
-
return
|
|
109
|
+
function p(e) {
|
|
110
|
+
return c(e).isLogin();
|
|
118
111
|
}
|
|
119
|
-
function
|
|
120
|
-
const
|
|
121
|
-
return (
|
|
122
|
-
var n;
|
|
123
|
-
return (n = a.config.authProvider) != null && n.can ? a.config.authProvider.can(u, e, a, r) : !0;
|
|
124
|
-
};
|
|
112
|
+
function L(e) {
|
|
113
|
+
const t = i(e), u = c(e).getUser();
|
|
114
|
+
return (r, o) => t.config.authProvider?.can ? t.config.authProvider.can(r, o, t, u) : !0;
|
|
125
115
|
}
|
|
126
116
|
export {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
117
|
+
L as useCan,
|
|
118
|
+
S as useCheck,
|
|
119
|
+
R as useError,
|
|
120
|
+
v as useForgotPassword,
|
|
121
|
+
y as useGetAuth,
|
|
122
|
+
p as useIsLogin,
|
|
123
|
+
w as useLogin,
|
|
124
|
+
P as useLogout,
|
|
125
|
+
T as useRegister,
|
|
126
|
+
E as useUpdatePassword
|
|
137
127
|
};
|