@pubinfo-nightly/module-crypto 2026.3.21 → 2026.3.23
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/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1114 -799
- package/dist/pages/components/drawerCryptoUrl.vue.d.ts +10 -0
- package/dist/pages/setting.vue.d.ts +3 -0
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/dist/drawerCryptoUrl-D1mGfabN.js +0 -110
- package/dist/setting-CwkOYk62.js +0 -217
- package/dist/setting.css +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare function onOpen(edit: boolean, list: API.UrlEntry[], index?: number): Promise<void>;
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {
|
|
3
|
+
open: typeof onOpen;
|
|
4
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
submit: (...args: any[]) => void;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
7
|
+
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pubinfo-nightly/module-crypto",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2026.03.
|
|
4
|
+
"version": "2026.03.23",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@ant-design/icons-vue": "^7.0.1",
|
|
24
24
|
"@pubinfo/pro-components": "^1.8.2",
|
|
25
25
|
"ant-design-vue": "^4.2.6",
|
|
26
|
-
"pubinfo-nightly": "2026.03.
|
|
26
|
+
"pubinfo-nightly": "2026.03.23"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@vueuse/core": "^14.2.1",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@pubinfo/pro-components": "^1.8.2",
|
|
37
37
|
"@types/crypto-js": "^4.2.2",
|
|
38
38
|
"ant-design-vue": "^4.2.6",
|
|
39
|
-
"pubinfo-nightly": "2026.03.
|
|
39
|
+
"pubinfo-nightly": "2026.03.23"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"dev": "pubinfo build -w --sourcemap",
|
package/src/index.ts
CHANGED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { i as e } from "./index.js";
|
|
2
|
-
import { Button as t, Drawer as n, Form as r, FormItem as i, Input as a, Space as o, Textarea as s } from "ant-design-vue/es";
|
|
3
|
-
import { createBlock as c, createTextVNode as l, createVNode as u, defineComponent as d, isRef as f, openBlock as p, ref as m, shallowRef as h, toValue as g, unref as _, withCtx as v } from "vue";
|
|
4
|
-
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
5
|
-
function y(e = !1, t = {}) {
|
|
6
|
-
let { truthyValue: n = !0, falsyValue: r = !1 } = t, i = f(e), a = h(e);
|
|
7
|
-
function o(e) {
|
|
8
|
-
if (arguments.length) return a.value = e, a.value;
|
|
9
|
-
{
|
|
10
|
-
let e = g(n);
|
|
11
|
-
return a.value = a.value === e ? g(r) : e, a.value;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return i ? o : [a, o];
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region src/pages/components/drawerCryptoUrl.vue?vue&type=script&setup=true&lang.ts
|
|
18
|
-
var b = /* @__PURE__ */ d({
|
|
19
|
-
name: "DrawerCryptoUrl",
|
|
20
|
-
__name: "drawerCryptoUrl",
|
|
21
|
-
emits: ["submit"],
|
|
22
|
-
setup(e, { expose: d, emit: h }) {
|
|
23
|
-
let g = h, b = { url: [{
|
|
24
|
-
required: !0,
|
|
25
|
-
validator: O,
|
|
26
|
-
trigger: ["blur", "change"]
|
|
27
|
-
}] }, [x, S] = y(!1), C = m(), w = m({}), T = m(!1), E = m([]), D = m(0);
|
|
28
|
-
function O(e, t, n) {
|
|
29
|
-
t ? /^\/(?!.*\*{3})(?:[\w-]+|:\w+|\*{1,2})(?:\/(?:[\w-]+|:\w+|\*{1,2}))*$/.test(t) ? n() : n(/* @__PURE__ */ Error("url格式不正确")) : n(/* @__PURE__ */ Error("请输入url"));
|
|
30
|
-
}
|
|
31
|
-
async function k(e, t, n) {
|
|
32
|
-
S(!0), E.value = t || [], D.value = n || 0, e ? (T.value = !0, w.value = { ...t?.[n || 0] }) : (T.value = !1, w.value = {});
|
|
33
|
-
}
|
|
34
|
-
let [A, j] = y(!1);
|
|
35
|
-
function M() {
|
|
36
|
-
C.value?.validate().then(() => {
|
|
37
|
-
j(!0);
|
|
38
|
-
let e = { ...w.value };
|
|
39
|
-
T.value ? E.value[D.value] = e : E.value.push(e), j(!1), N(), g("submit", E.value);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function N() {
|
|
43
|
-
S(!1);
|
|
44
|
-
}
|
|
45
|
-
return d({ open: k }), (e, d) => {
|
|
46
|
-
let m = a, h = i, g = s, y = r, S = t, T = o, E = n;
|
|
47
|
-
return p(), c(E, {
|
|
48
|
-
open: _(x),
|
|
49
|
-
"onUpdate:open": d[3] ||= (e) => f(x) ? x.value = e : null,
|
|
50
|
-
title: "url信息",
|
|
51
|
-
placement: "right",
|
|
52
|
-
width: 600,
|
|
53
|
-
"destroy-on-close": "",
|
|
54
|
-
"footer-style": { textAlign: "right" },
|
|
55
|
-
onClose: N
|
|
56
|
-
}, {
|
|
57
|
-
footer: v(() => [u(T, null, {
|
|
58
|
-
default: v(() => [u(S, { onClick: N }, {
|
|
59
|
-
default: v(() => [...d[4] ||= [l(" 取消 ", -1)]]),
|
|
60
|
-
_: 1
|
|
61
|
-
}), u(S, {
|
|
62
|
-
type: "primary",
|
|
63
|
-
loading: _(A),
|
|
64
|
-
onClick: d[2] ||= (e) => M()
|
|
65
|
-
}, {
|
|
66
|
-
default: v(() => [...d[5] ||= [l(" 提交 ", -1)]]),
|
|
67
|
-
_: 1
|
|
68
|
-
}, 8, ["loading"])]),
|
|
69
|
-
_: 1
|
|
70
|
-
})]),
|
|
71
|
-
default: v(() => [u(y, {
|
|
72
|
-
ref_key: "formRef",
|
|
73
|
-
ref: C,
|
|
74
|
-
model: _(w),
|
|
75
|
-
rules: b,
|
|
76
|
-
"label-col": { style: { width: "90px" } }
|
|
77
|
-
}, {
|
|
78
|
-
default: v(() => [u(h, {
|
|
79
|
-
label: "url地址",
|
|
80
|
-
name: "url",
|
|
81
|
-
tooltip: "支持url通配符,示例:/api/v1/user/*,/api/login/**"
|
|
82
|
-
}, {
|
|
83
|
-
default: v(() => [u(m, {
|
|
84
|
-
value: _(w).url,
|
|
85
|
-
"onUpdate:value": d[0] ||= (e) => _(w).url = e,
|
|
86
|
-
maxlength: 200
|
|
87
|
-
}, null, 8, ["value"])]),
|
|
88
|
-
_: 1
|
|
89
|
-
}), u(h, {
|
|
90
|
-
label: "描述",
|
|
91
|
-
name: "description"
|
|
92
|
-
}, {
|
|
93
|
-
default: v(() => [u(g, {
|
|
94
|
-
value: _(w).description,
|
|
95
|
-
"onUpdate:value": d[1] ||= (e) => _(w).description = e,
|
|
96
|
-
rows: 3,
|
|
97
|
-
"show-count": "",
|
|
98
|
-
maxlength: 200
|
|
99
|
-
}, null, 8, ["value"])]),
|
|
100
|
-
_: 1
|
|
101
|
-
})]),
|
|
102
|
-
_: 1
|
|
103
|
-
}, 8, ["model"])]),
|
|
104
|
-
_: 1
|
|
105
|
-
}, 8, ["open"]);
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
}), x = /* @__PURE__ */ e({ default: () => S }), S = b;
|
|
109
|
-
//#endregion
|
|
110
|
-
export { x as n, y as r, S as t };
|
package/dist/setting-CwkOYk62.js
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./index.js";
|
|
2
|
-
import { r, t as i } from "./drawerCryptoUrl-D1mGfabN.js";
|
|
3
|
-
import { PubinfoIcon as a, useAuth as o } from "pubinfo-nightly";
|
|
4
|
-
import { Button as s, CheckableTag as ee, Form as c, FormItem as l, Space as te, Switch as u } from "ant-design-vue/es";
|
|
5
|
-
import { createBlock as d, createCommentVNode as ne, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, normalizeClass as _, onMounted as v, openBlock as y, reactive as b, ref as x, resolveDirective as re, toDisplayString as S, unref as C, withCtx as w, withDirectives as T } from "vue";
|
|
6
|
-
import { PlusCircleOutlined as E, QuestionCircleOutlined as ie } from "@ant-design/icons-vue";
|
|
7
|
-
import { ProTable as ae } from "@pubinfo/pro-components";
|
|
8
|
-
import { Modal as D, message as O } from "ant-design-vue";
|
|
9
|
-
import './setting.css';//#region src/pages/enum.ts
|
|
10
|
-
var k = /* @__PURE__ */ function(e) {
|
|
11
|
-
return e.ADD = "新增", e.EDIT = "编辑", e.REMOVE = "删除", e.ENABLE = "启用", e.DISABLE = "停用", e;
|
|
12
|
-
}({}), oe = {
|
|
13
|
-
"w-full": "",
|
|
14
|
-
"h-full": "",
|
|
15
|
-
"pt-10px": "",
|
|
16
|
-
"px-10px": "",
|
|
17
|
-
"overflow-auto": ""
|
|
18
|
-
}, A = {
|
|
19
|
-
"h-full": "",
|
|
20
|
-
"min-w-1130px": ""
|
|
21
|
-
}, j = { class: "pt-20px pl-20px h-161px flex flex-col bg-[#ffffff] box-border bg-[url('@/assets/images/crypto-setting-bg.png')] bg-cover text-[#4e5969] dark:text-[#C9CDD4]" }, M = { class: "flex items-center" }, N = { class: "p-5px bg-[#f2f3f5] rounded-5px flex items-center" }, P = { class: "flex items-center ml-15px text-[#a3a4a8]" }, F = { class: "h-[calc(100%-165px)]" }, I = ["onClick"], L = { class: "ml-4px" }, R = ["onClick"], z = { class: "ml-4px" }, B = /* @__PURE__ */ ((e, t) => {
|
|
22
|
-
let n = e.__vccOpts || e;
|
|
23
|
-
for (let [e, r] of t) n[e] = r;
|
|
24
|
-
return n;
|
|
25
|
-
})(/* @__PURE__ */ g({
|
|
26
|
-
__name: "setting",
|
|
27
|
-
setup(g) {
|
|
28
|
-
let B = x(), V = x(), H = x(), U = { style: { width: "auto" } }, W = { span: 24 }, { auth: G } = o(), K = b({
|
|
29
|
-
isCrypto: !0,
|
|
30
|
-
mode: !0,
|
|
31
|
-
whiteListUrls: []
|
|
32
|
-
}), [q, J] = r(!1);
|
|
33
|
-
v(Y);
|
|
34
|
-
async function Y() {
|
|
35
|
-
await e().then((e) => {
|
|
36
|
-
J(!1), e && e.data && e.success && (K.isCrypto = e.data.cryptoEnabled || !1, K.whiteListUrls = e.data.cryptoWhitePath, K.mode = e.data.cryptoMode === void 0 ? !0 : e.data.cryptoMode);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
function X(e, t) {
|
|
40
|
-
t && (K.mode = e, Z());
|
|
41
|
-
}
|
|
42
|
-
async function Z() {
|
|
43
|
-
if (!q.value) {
|
|
44
|
-
J(!0);
|
|
45
|
-
try {
|
|
46
|
-
await V.value?.validate();
|
|
47
|
-
let { isCrypto: e, mode: r, whiteListUrls: i } = K, a = {
|
|
48
|
-
cryptoEnabled: e,
|
|
49
|
-
cryptoMode: r,
|
|
50
|
-
cryptoWhitePath: i
|
|
51
|
-
}, { success: o } = await t({ json: JSON.stringify(a) });
|
|
52
|
-
o && (O.success("配置更改成功"), n.callAsync({
|
|
53
|
-
...n.use(),
|
|
54
|
-
isCrypto: K.isCrypto,
|
|
55
|
-
cryptoMode: K.mode,
|
|
56
|
-
whiteListUrls: K.whiteListUrls
|
|
57
|
-
}, () => {
|
|
58
|
-
Y();
|
|
59
|
-
}));
|
|
60
|
-
} catch {
|
|
61
|
-
J(!1);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
let se = [
|
|
66
|
-
{
|
|
67
|
-
minWidth: 60,
|
|
68
|
-
hideInTable: !1,
|
|
69
|
-
title: "url地址",
|
|
70
|
-
dataIndex: "url"
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
hideInSearch: !0,
|
|
74
|
-
minWidth: 200,
|
|
75
|
-
title: "描述",
|
|
76
|
-
dataIndex: "description",
|
|
77
|
-
ellipsis: !0
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
hideInSearch: !0,
|
|
81
|
-
title: "操作",
|
|
82
|
-
dataIndex: "action",
|
|
83
|
-
width: 200,
|
|
84
|
-
fixed: "right",
|
|
85
|
-
hideInTable() {
|
|
86
|
-
return !G([
|
|
87
|
-
"crypto_url_add",
|
|
88
|
-
"crypto_url_edit",
|
|
89
|
-
"crypto_url_delete"
|
|
90
|
-
]);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
];
|
|
94
|
-
function Q(e, t) {
|
|
95
|
-
if (!q.value) switch (e) {
|
|
96
|
-
case k.ADD:
|
|
97
|
-
H.value.open(!1, K.whiteListUrls);
|
|
98
|
-
break;
|
|
99
|
-
case k.EDIT:
|
|
100
|
-
H.value.open(!0, K.whiteListUrls, t);
|
|
101
|
-
break;
|
|
102
|
-
case k.REMOVE:
|
|
103
|
-
ce(K.whiteListUrls || [], t || 0);
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
function ce(e, t) {
|
|
108
|
-
D.confirm({
|
|
109
|
-
title: "删除",
|
|
110
|
-
content: "确定要删除该条数据吗?",
|
|
111
|
-
async onOk() {
|
|
112
|
-
e.splice(t, 1), $(e);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
function $(e) {
|
|
117
|
-
K.whiteListUrls = e, Z();
|
|
118
|
-
}
|
|
119
|
-
return (e, t) => {
|
|
120
|
-
let n = u, r = l, o = ee, g = c, v = E, b = s, x = a, D = te, O = re("auth");
|
|
121
|
-
return y(), f("div", oe, [p("div", A, [p("div", j, [h(g, {
|
|
122
|
-
ref_key: "formRef",
|
|
123
|
-
ref: V,
|
|
124
|
-
model: K,
|
|
125
|
-
"label-col": U,
|
|
126
|
-
"wrapper-col": W,
|
|
127
|
-
class: "safe-rule-form"
|
|
128
|
-
}, {
|
|
129
|
-
default: w(() => [h(r, {
|
|
130
|
-
label: "开启加密",
|
|
131
|
-
name: "isCrypto"
|
|
132
|
-
}, {
|
|
133
|
-
default: w(() => [h(n, {
|
|
134
|
-
checked: K.isCrypto,
|
|
135
|
-
"onUpdate:checked": t[0] ||= (e) => K.isCrypto = e,
|
|
136
|
-
disabled: C(q),
|
|
137
|
-
onChange: Z
|
|
138
|
-
}, null, 8, ["checked", "disabled"])]),
|
|
139
|
-
_: 1
|
|
140
|
-
}), h(r, {
|
|
141
|
-
label: "模式",
|
|
142
|
-
name: "isCrypto"
|
|
143
|
-
}, {
|
|
144
|
-
default: w(() => [p("div", M, [p("div", N, [h(o, {
|
|
145
|
-
checked: K.mode,
|
|
146
|
-
disabled: C(q),
|
|
147
|
-
class: _(C(q) ? "cursor-not-allowed!" : ""),
|
|
148
|
-
onChange: t[1] ||= (e) => !C(q) && X(!0, e)
|
|
149
|
-
}, {
|
|
150
|
-
default: w(() => [...t[4] ||= [m(" 白名单 ", -1)]]),
|
|
151
|
-
_: 1
|
|
152
|
-
}, 8, [
|
|
153
|
-
"checked",
|
|
154
|
-
"disabled",
|
|
155
|
-
"class"
|
|
156
|
-
]), h(o, {
|
|
157
|
-
checked: !K.mode,
|
|
158
|
-
class: _(["mr-0px!", C(q) ? "cursor-not-allowed!" : ""]),
|
|
159
|
-
onChange: t[2] ||= (e) => !C(q) && X(!1, e)
|
|
160
|
-
}, {
|
|
161
|
-
default: w(() => [...t[5] ||= [m(" 黑名单 ", -1)]]),
|
|
162
|
-
_: 1
|
|
163
|
-
}, 8, ["checked", "class"])]), p("div", P, [h(C(ie), { class: "mr-5px" }), t[6] ||= m("白名单模式下,仅不加密过滤列表中的接口;黑名单模式下,仅加密过滤列表中的接口。 ", -1)])])]),
|
|
164
|
-
_: 1
|
|
165
|
-
})]),
|
|
166
|
-
_: 1
|
|
167
|
-
}, 8, ["model"])]), p("div", F, [h(C(ae), {
|
|
168
|
-
ref_key: "tableRef",
|
|
169
|
-
ref: B,
|
|
170
|
-
"row-key": "id",
|
|
171
|
-
"data-source": K.whiteListUrls,
|
|
172
|
-
columns: se,
|
|
173
|
-
"auto-height": "",
|
|
174
|
-
search: !1,
|
|
175
|
-
pagination: !1,
|
|
176
|
-
scroll: { x: 1e3 }
|
|
177
|
-
}, {
|
|
178
|
-
toolbar: w(() => [T((y(), d(b, {
|
|
179
|
-
type: "primary",
|
|
180
|
-
disabled: C(q),
|
|
181
|
-
onClick: t[3] ||= (e) => Q(C(k).ADD)
|
|
182
|
-
}, {
|
|
183
|
-
default: w(() => [h(v), m(" " + S(C(k).ADD), 1)]),
|
|
184
|
-
_: 1
|
|
185
|
-
}, 8, ["disabled"])), [[O, "crypto_url_add"]])]),
|
|
186
|
-
bodyCell: w(({ column: e, index: t }) => [e.dataIndex === "action" ? (y(), d(D, { key: 0 }, {
|
|
187
|
-
default: w(() => [T((y(), f("a", {
|
|
188
|
-
class: "flex items-center hover:opacity-80",
|
|
189
|
-
onClick: (e) => Q(C(k).EDIT, t)
|
|
190
|
-
}, [h(x, {
|
|
191
|
-
name: "edit",
|
|
192
|
-
class: "text-base"
|
|
193
|
-
}), p("span", L, S(C(k).EDIT), 1)], 8, I)), [[O, "crypto_url_edit"]]), T((y(), f("span", {
|
|
194
|
-
flex: "",
|
|
195
|
-
"items-center": "",
|
|
196
|
-
"text-red-500": "",
|
|
197
|
-
"hover:cursor-pointer": "",
|
|
198
|
-
"hover:text-red-500": "",
|
|
199
|
-
"hover:opacity-80": "",
|
|
200
|
-
onClick: (e) => Q(C(k).REMOVE, t)
|
|
201
|
-
}, [h(x, {
|
|
202
|
-
name: "remove",
|
|
203
|
-
class: "text-base"
|
|
204
|
-
}), p("span", z, S(C(k).REMOVE), 1)], 8, R)), [[O, "crypto_url_delete"]])]),
|
|
205
|
-
_: 2
|
|
206
|
-
}, 1024)) : ne("", !0)]),
|
|
207
|
-
_: 1
|
|
208
|
-
}, 8, ["data-source"])])]), h(i, {
|
|
209
|
-
ref_key: "drawerRef",
|
|
210
|
-
ref: H,
|
|
211
|
-
onSubmit: $
|
|
212
|
-
}, null, 512)]);
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
}), [["__scopeId", "data-v-89197708"]]);
|
|
216
|
-
//#endregion
|
|
217
|
-
export { B as default };
|
package/dist/setting.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.safe-rule-form .ant-input[data-v-89197708],.safe-rule-form .ant-select[data-v-89197708]{width:90%}.safe-rule-form[data-v-89197708] .ant-tag-checkable-checked{color:#1677ff;background:#fff;font-size:13px}.safe-rule-form[data-v-89197708] .ant-tag-checkable{font-size:13px}
|