@pubinfo-nightly/module-crypto 2025.12.9 → 2025.12.26
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/api/modules/crypto/pubSysConfigController.d.ts +4 -4
- package/dist/api/request.d.ts +1 -1
- package/dist/apiContext.d.ts +2 -2
- package/dist/context.d.ts +2 -2
- package/dist/cryptoAlg/aes.d.ts +1 -1
- package/dist/cryptoAlg/sm4-cbc.d.ts +1 -1
- package/dist/cryptoAlg/sm4-ecb.d.ts +1 -1
- package/dist/cryptoSetting.d.ts +2 -2
- package/dist/drawerCryptoUrl-CKgf1Uxz.js +106 -0
- package/dist/drawerCryptoUrl-DltbAlje.js +2 -0
- package/dist/helper.d.ts +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7589 -8951
- package/dist/interface.d.ts +1 -1
- package/dist/setting-DkwAGQxz.js +216 -0
- package/dist/setting.css +1 -1
- package/package.json +4 -4
- package/src/cryptoSetting.ts +1 -1
- package/src/index.ts +0 -5
- package/dist/drawerCryptoUrl-pN2BPC_q.js +0 -4
- package/dist/drawerCryptoUrl.vue_vue_type_script_setup_true_lang-CztdWly1.js +0 -136
- package/dist/setting-2FfcqVsW.js +0 -267
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { basic as request } from '
|
|
1
|
+
import { basic as request } from '@/api/request';
|
|
2
2
|
/**
|
|
3
3
|
* @description 编辑加解密配置
|
|
4
4
|
* @url /crypto/editCryptoConfig
|
|
5
5
|
* @method POST
|
|
6
6
|
* @author @pubinfo/openapi
|
|
7
7
|
*/
|
|
8
|
-
export declare function postCryptoEditCryptoConfig<R = API.ResponseDataBoolean, T = API.ResponseDataBoolean>(body: API.EditCryptoConfigDto, options?: Parameters<typeof request.Post<R, T>>[2]): import(
|
|
8
|
+
export declare function postCryptoEditCryptoConfig<R = API.ResponseDataBoolean, T = API.ResponseDataBoolean>(body: API.EditCryptoConfigDto, options?: Parameters<typeof request.Post<R, T>>[2]): import("alova").Method<import("alova").RespondedAlovaGenerics<import("pubinfo-nightly").AG, R, T>>;
|
|
9
9
|
/**
|
|
10
10
|
* @description 获取加解密配置
|
|
11
11
|
* @url /crypto/getCryptoConfig
|
|
12
12
|
* @method GET
|
|
13
13
|
* @author @pubinfo/openapi
|
|
14
14
|
*/
|
|
15
|
-
export declare function getCryptoGetCryptoConfig<R = API.ResponseDataCryptoConfig, T = API.ResponseDataCryptoConfig>(options?: Parameters<typeof request.Get<R, T>>[1]): import(
|
|
15
|
+
export declare function getCryptoGetCryptoConfig<R = API.ResponseDataCryptoConfig, T = API.ResponseDataCryptoConfig>(options?: Parameters<typeof request.Get<R, T>>[1]): import("alova").Method<import("alova").RespondedAlovaGenerics<import("pubinfo-nightly").AG, R, T>>;
|
|
16
16
|
/**
|
|
17
17
|
* @description 获取公钥及加解密配置
|
|
18
18
|
* @url /crypto/getPublicKeyAndConfig
|
|
19
19
|
* @method GET
|
|
20
20
|
* @author @pubinfo/openapi
|
|
21
21
|
*/
|
|
22
|
-
export declare function getCryptoGetPublicKeyAndConfig<R = API.ResponseDataCryptoConfigExt, T = API.ResponseDataCryptoConfigExt>(options?: Parameters<typeof request.Get<R, T>>[1]): import(
|
|
22
|
+
export declare function getCryptoGetPublicKeyAndConfig<R = API.ResponseDataCryptoConfigExt, T = API.ResponseDataCryptoConfigExt>(options?: Parameters<typeof request.Get<R, T>>[1]): import("alova").Method<import("alova").RespondedAlovaGenerics<import("pubinfo-nightly").AG, R, T>>;
|
package/dist/api/request.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const basic: import(
|
|
1
|
+
export declare const basic: import("pubinfo-nightly").RequestInstance;
|
package/dist/apiContext.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { InternalContext } from './interface';
|
|
2
|
-
export declare const apictx: import(
|
|
1
|
+
import type { InternalContext } from './interface';
|
|
2
|
+
export declare const apictx: import("unctx").UseContext<InternalContext>;
|
package/dist/context.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { cryptoInternal } from './interface';
|
|
2
|
-
export declare const ctx: import(
|
|
1
|
+
import type { cryptoInternal } from './interface';
|
|
2
|
+
export declare const ctx: import("unctx").UseContext<{
|
|
3
3
|
isCrypto: boolean;
|
|
4
4
|
cryptoSetting: cryptoInternal;
|
|
5
5
|
whiteListUrls?: API.UrlEntry[];
|
package/dist/cryptoAlg/aes.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cryptoInternal } from '
|
|
1
|
+
import type { cryptoInternal } from '@/interface';
|
|
2
2
|
export declare function aesEncrypt(plainText: string): Promise<string>;
|
|
3
3
|
export declare function aesDecrypt(cipherText: string): Promise<string>;
|
|
4
4
|
export declare function setupAes(): cryptoInternal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cryptoInternal } from '
|
|
1
|
+
import type { cryptoInternal } from '@/interface';
|
|
2
2
|
export declare function sm4CBCEncrypt(plainText: string): Promise<string>;
|
|
3
3
|
export declare function sm4CBCDecrypt(cipherText: string): Promise<string>;
|
|
4
4
|
export declare function setupSm4Cbc(): cryptoInternal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cryptoInternal } from '
|
|
1
|
+
import type { cryptoInternal } from '@/interface';
|
|
2
2
|
export declare function sm4ECBEncrypt(plainText: string): Promise<string>;
|
|
3
3
|
export declare function sm4ECBDecrypt(cipherText: string): Promise<string>;
|
|
4
4
|
export declare function setupSm4Ecb(): cryptoInternal;
|
package/dist/cryptoSetting.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RequestMethod } from 'pubinfo-nightly';
|
|
2
|
-
import { cryptoInternal } from './interface';
|
|
1
|
+
import type { RequestMethod } from 'pubinfo-nightly';
|
|
2
|
+
import type { cryptoInternal } from './interface';
|
|
3
3
|
export declare function isMethodNeedCrypto(url: string, isCrypto: boolean, cryptoMode: boolean, whiteListUrls?: API.UrlEntry[]): boolean;
|
|
4
4
|
export declare function isUrlInWhiteList(url: string, cryptoMode: boolean, whiteListUrls?: API.UrlEntry[]): boolean;
|
|
5
5
|
export declare function encrypt(method: RequestMethod, cryptoSetting: cryptoInternal): Promise<void>;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Button, Drawer, Form, FormItem, Input, Space, Textarea } from "ant-design-vue/es";
|
|
2
|
+
import { createBlock, createTextVNode, createVNode, defineComponent, isRef, onMounted, openBlock, reactive, ref, shallowRef, toValue, unref, withCtx } from "vue";
|
|
3
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
4
|
+
function useToggle(e = !1, c = {}) {
|
|
5
|
+
let { truthyValue: l = !0, falsyValue: u = !1 } = c, d = isRef(e), f = shallowRef(e);
|
|
6
|
+
function p(e) {
|
|
7
|
+
if (arguments.length) return f.value = e, f.value;
|
|
8
|
+
{
|
|
9
|
+
let e = toValue(l);
|
|
10
|
+
return f.value = f.value === e ? toValue(u) : e, f.value;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return d ? p : [f, p];
|
|
14
|
+
}
|
|
15
|
+
var drawerCryptoUrl_default = /* @__PURE__ */ defineComponent({
|
|
16
|
+
name: "DrawerCryptoUrl",
|
|
17
|
+
__name: "drawerCryptoUrl",
|
|
18
|
+
emits: ["submit"],
|
|
19
|
+
setup(m, { expose: h, emit: g }) {
|
|
20
|
+
let v = g, y = { url: [{
|
|
21
|
+
required: !0,
|
|
22
|
+
validator: O,
|
|
23
|
+
trigger: ["blur", "change"]
|
|
24
|
+
}] }, [x, S] = useToggle(!1), C = ref(), w = ref({}), T = ref(!1), E = ref([]), D = ref(0);
|
|
25
|
+
function O(e, c, l) {
|
|
26
|
+
c ? /^\/(?!.*\*{3})(?:[\w-]+|:\w+|\*{1,2})(?:\/(?:[\w-]+|:\w+|\*{1,2}))*$/.test(c) ? l() : l(/* @__PURE__ */ Error("url格式不正确")) : l(/* @__PURE__ */ Error("请输入url"));
|
|
27
|
+
}
|
|
28
|
+
async function k(e, c, l) {
|
|
29
|
+
S(!0), E.value = c || [], D.value = l || 0, e ? (T.value = !0, w.value = { ...c?.[l || 0] }) : (T.value = !1, w.value = {});
|
|
30
|
+
}
|
|
31
|
+
let [A, j] = useToggle(!1);
|
|
32
|
+
function M() {
|
|
33
|
+
C.value?.validate().then(() => {
|
|
34
|
+
j(!0);
|
|
35
|
+
let e = { ...w.value };
|
|
36
|
+
T.value ? E.value[D.value] = e : E.value.push(e), j(!1), N(), v("submit", E.value);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function N() {
|
|
40
|
+
S(!1);
|
|
41
|
+
}
|
|
42
|
+
return h({ open: k }), (m, h) => {
|
|
43
|
+
let g = Input, _ = FormItem, v = Textarea, b = Form, S = Button, T = Space, E = Drawer;
|
|
44
|
+
return openBlock(), createBlock(E, {
|
|
45
|
+
open: unref(x),
|
|
46
|
+
"onUpdate:open": h[3] ||= (e) => isRef(x) ? x.value = e : null,
|
|
47
|
+
title: "url信息",
|
|
48
|
+
placement: "right",
|
|
49
|
+
width: 600,
|
|
50
|
+
"destroy-on-close": "",
|
|
51
|
+
"footer-style": { textAlign: "right" },
|
|
52
|
+
onClose: N
|
|
53
|
+
}, {
|
|
54
|
+
footer: withCtx(() => [createVNode(T, null, {
|
|
55
|
+
default: withCtx(() => [createVNode(S, { onClick: N }, {
|
|
56
|
+
default: withCtx(() => [...h[4] ||= [createTextVNode(" 取消 ", -1)]]),
|
|
57
|
+
_: 1
|
|
58
|
+
}), createVNode(S, {
|
|
59
|
+
type: "primary",
|
|
60
|
+
loading: unref(A),
|
|
61
|
+
onClick: h[2] ||= (e) => M()
|
|
62
|
+
}, {
|
|
63
|
+
default: withCtx(() => [...h[5] ||= [createTextVNode(" 提交 ", -1)]]),
|
|
64
|
+
_: 1
|
|
65
|
+
}, 8, ["loading"])]),
|
|
66
|
+
_: 1
|
|
67
|
+
})]),
|
|
68
|
+
default: withCtx(() => [createVNode(b, {
|
|
69
|
+
ref_key: "formRef",
|
|
70
|
+
ref: C,
|
|
71
|
+
model: unref(w),
|
|
72
|
+
rules: y,
|
|
73
|
+
"label-col": { style: { width: "90px" } }
|
|
74
|
+
}, {
|
|
75
|
+
default: withCtx(() => [createVNode(_, {
|
|
76
|
+
label: "url地址",
|
|
77
|
+
name: "url",
|
|
78
|
+
tooltip: "支持url通配符,示例:/api/v1/user/*,/api/login/**"
|
|
79
|
+
}, {
|
|
80
|
+
default: withCtx(() => [createVNode(g, {
|
|
81
|
+
value: unref(w).url,
|
|
82
|
+
"onUpdate:value": h[0] ||= (e) => unref(w).url = e,
|
|
83
|
+
maxlength: 200
|
|
84
|
+
}, null, 8, ["value"])]),
|
|
85
|
+
_: 1
|
|
86
|
+
}), createVNode(_, {
|
|
87
|
+
label: "描述",
|
|
88
|
+
name: "description"
|
|
89
|
+
}, {
|
|
90
|
+
default: withCtx(() => [createVNode(v, {
|
|
91
|
+
value: unref(w).description,
|
|
92
|
+
"onUpdate:value": h[1] ||= (e) => unref(w).description = e,
|
|
93
|
+
rows: 3,
|
|
94
|
+
"show-count": "",
|
|
95
|
+
maxlength: 200
|
|
96
|
+
}, null, 8, ["value"])]),
|
|
97
|
+
_: 1
|
|
98
|
+
})]),
|
|
99
|
+
_: 1
|
|
100
|
+
}, 8, ["model"])]),
|
|
101
|
+
_: 1
|
|
102
|
+
}, 8, ["open"]);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
export { useToggle as n, drawerCryptoUrl_default as t };
|
package/dist/helper.d.ts
CHANGED