szld-libs 0.2.22 → 0.2.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/es/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import CryptoJS from "crypto-js";
3
2
  import { useEffect } from "react";
4
3
  import ReactDOM from "react-dom/client";
5
4
  import { BrowserRouter } from "react-router-dom";
6
5
  import useConfig from "./hooks/useConfig";
6
+ import { AES } from "./main";
7
7
  let key = "U2FsdGVkX1/dG1NSXNR9hnp3Ech/v6Gh8CDDJxgBm1EPFQel12ySIf84ARXCPwTae7TzwgPvjOyE3S5rAEzl/wAZmId6pbezpFeFcJqxdmIl3FeluYHFxJzQHDETTvrr3G/REvv00kHptOVwg6ecjPH6yk7PNit0sWTBLorROxLxMD8lVDmOA66p7Zp4QnYzqScYJGFbutmfHYXfBRBe1Q2UKummJ798svNY5SIwEwl4spzgyWmhARtuyq4zhysFrj/xODuNDjtwitA6XfX566WcZkj3F+2P+mkYzDYOhXXaomnlybjrZ2hEHfcczQhUfJd89O8PNIuEWo24wjYRgMdKlw5CWSeocFCqV7ZJ/CV/7vNRcaO4awKlFNobLikkwDznxpcX+4UEej+ED+pgfmPQLsKedcfEscStkSAZXaD5pBRTiFU9xGLfDt6seUrEnMBeXkpMIY9j1SZDDK18/G7lSHjDQMZYZP6sfLdBdwY=";
8
8
  const Demo = () => {
9
9
  useConfig(key);
@@ -11,14 +11,15 @@ const Demo = () => {
11
11
  jiami();
12
12
  }, []);
13
13
  const jiami = () => {
14
- CryptoJS.AES.encrypt(JSON.stringify({
14
+ const aes = new AES();
15
+ aes.encrypt(JSON.stringify({
15
16
  AppID: "GZY_SZLD_GZYDP",
16
17
  Password: "GZY_SZLD_GZYDP2557013",
17
18
  copyright: " © 云雁科技有限公司 2023 版权所有",
18
19
  icp: 'ICP备案/许可证号:<a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">湘B2-20090059</a> 公网安备号 44030502008569 隐私政策',
19
20
  tel: "400-607-0705",
20
21
  Salt: "HnSzldjt#2557013#"
21
- }), "SzlDJd#4202");
22
+ }));
22
23
  };
23
24
  return /* @__PURE__ */ jsx("div", { style: { height: "100vh" }, children: "测试页面" });
24
25
  };
package/es/main.d.ts CHANGED
@@ -16,5 +16,6 @@ import useChangePwd from "./hooks/useChangePwd";
16
16
  import useConfig from "./hooks/useConfig";
17
17
  import useRemember from "./hooks/useRemember";
18
18
  import useRowSelection from "./hooks/useRowSelection";
19
+ import AES from "./utils/aes";
19
20
  import HmacSHA512 from './utils/hmacSHA512';
20
- export { AuthButton, BackHeader, CoralButton, CreateForm, EditTable, FormRules, HmacSHA512, SearchTable, UploadFile, download, fileType, showWorkFlow, useCaptcha, useChangePwd, useConfig, useRemember, useRowSelection, utils, verfyCode };
21
+ export { AES, AuthButton, BackHeader, CoralButton, CreateForm, EditTable, FormRules, HmacSHA512, SearchTable, UploadFile, download, fileType, showWorkFlow, useCaptcha, useChangePwd, useConfig, useRemember, useRowSelection, utils, verfyCode };
package/es/main.js CHANGED
@@ -16,15 +16,17 @@ import { default as default11 } from "./hooks/useChangePwd";
16
16
  import { default as default12 } from "./hooks/useConfig";
17
17
  import { default as default13 } from "./hooks/useRemember";
18
18
  import { default as default14 } from "./hooks/useRowSelection";
19
- import { default as default15 } from "./utils/hmacSHA512";
19
+ import { default as default15 } from "./utils/aes";
20
+ import { default as default16 } from "./utils/hmacSHA512";
20
21
  export {
22
+ default15 as AES,
21
23
  default7 as AuthButton,
22
24
  default2 as BackHeader,
23
25
  default8 as CoralButton,
24
26
  default3 as CreateForm,
25
27
  default6 as EditTable,
26
28
  formRules as FormRules,
27
- default15 as HmacSHA512,
29
+ default16 as HmacSHA512,
28
30
  default4 as SearchTable,
29
31
  default5 as UploadFile,
30
32
  download,
@@ -0,0 +1,7 @@
1
+ declare class AES {
2
+ salt: string;
3
+ constructor();
4
+ encrypt(value: string): string | undefined;
5
+ decrypt(value: string): string | undefined;
6
+ }
7
+ export default AES;
@@ -0,0 +1,28 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
7
+ import CryptoJS from "crypto-js";
8
+ class AES {
9
+ constructor() {
10
+ __publicField(this, "salt", "SzlDJd#4202");
11
+ }
12
+ encrypt(value) {
13
+ if (!value) {
14
+ return;
15
+ }
16
+ const msg = typeof value === "string" ? value : JSON.stringify(value);
17
+ return CryptoJS.AES.encrypt(msg, this.salt).toString();
18
+ }
19
+ decrypt(value) {
20
+ if (!value) {
21
+ return;
22
+ }
23
+ return CryptoJS.AES.decrypt(value, this.salt).toString(CryptoJS.enc.Utf8);
24
+ }
25
+ }
26
+ export {
27
+ AES as default
28
+ };
package/lib/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
- const CryptoJS = require("crypto-js");
4
3
  const react = require("react");
5
4
  const ReactDOM = require("react-dom/client");
6
5
  const reactRouterDom = require("react-router-dom");
7
6
  const useConfig = require("./hooks/useConfig");
7
+ const main = require("./main");
8
8
  let key = "U2FsdGVkX1/dG1NSXNR9hnp3Ech/v6Gh8CDDJxgBm1EPFQel12ySIf84ARXCPwTae7TzwgPvjOyE3S5rAEzl/wAZmId6pbezpFeFcJqxdmIl3FeluYHFxJzQHDETTvrr3G/REvv00kHptOVwg6ecjPH6yk7PNit0sWTBLorROxLxMD8lVDmOA66p7Zp4QnYzqScYJGFbutmfHYXfBRBe1Q2UKummJ798svNY5SIwEwl4spzgyWmhARtuyq4zhysFrj/xODuNDjtwitA6XfX566WcZkj3F+2P+mkYzDYOhXXaomnlybjrZ2hEHfcczQhUfJd89O8PNIuEWo24wjYRgMdKlw5CWSeocFCqV7ZJ/CV/7vNRcaO4awKlFNobLikkwDznxpcX+4UEej+ED+pgfmPQLsKedcfEscStkSAZXaD5pBRTiFU9xGLfDt6seUrEnMBeXkpMIY9j1SZDDK18/G7lSHjDQMZYZP6sfLdBdwY=";
9
9
  const Demo = () => {
10
10
  useConfig(key);
@@ -12,14 +12,15 @@ const Demo = () => {
12
12
  jiami();
13
13
  }, []);
14
14
  const jiami = () => {
15
- CryptoJS.AES.encrypt(JSON.stringify({
15
+ const aes = new main.AES();
16
+ aes.encrypt(JSON.stringify({
16
17
  AppID: "GZY_SZLD_GZYDP",
17
18
  Password: "GZY_SZLD_GZYDP2557013",
18
19
  copyright: " © 云雁科技有限公司 2023 版权所有",
19
20
  icp: 'ICP备案/许可证号:<a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">湘B2-20090059</a> 公网安备号 44030502008569 隐私政策',
20
21
  tel: "400-607-0705",
21
22
  Salt: "HnSzldjt#2557013#"
22
- }), "SzlDJd#4202");
23
+ }));
23
24
  };
24
25
  return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: "100vh" }, children: "测试页面" });
25
26
  };
package/lib/main.d.ts CHANGED
@@ -16,5 +16,6 @@ import useChangePwd from "./hooks/useChangePwd";
16
16
  import useConfig from "./hooks/useConfig";
17
17
  import useRemember from "./hooks/useRemember";
18
18
  import useRowSelection from "./hooks/useRowSelection";
19
+ import AES from "./utils/aes";
19
20
  import HmacSHA512 from './utils/hmacSHA512';
20
- export { AuthButton, BackHeader, CoralButton, CreateForm, EditTable, FormRules, HmacSHA512, SearchTable, UploadFile, download, fileType, showWorkFlow, useCaptcha, useChangePwd, useConfig, useRemember, useRowSelection, utils, verfyCode };
21
+ export { AES, AuthButton, BackHeader, CoralButton, CreateForm, EditTable, FormRules, HmacSHA512, SearchTable, UploadFile, download, fileType, showWorkFlow, useCaptcha, useChangePwd, useConfig, useRemember, useRowSelection, utils, verfyCode };
package/lib/main.js CHANGED
@@ -18,6 +18,7 @@ const useChangePwd = require("./hooks/useChangePwd");
18
18
  const useConfig = require("./hooks/useConfig");
19
19
  const useRemember = require("./hooks/useRemember");
20
20
  const useRowSelection = require("./hooks/useRowSelection");
21
+ const aes = require("./utils/aes");
21
22
  const hmacSHA512 = require("./utils/hmacSHA512");
22
23
  function _interopNamespaceDefault(e) {
23
24
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -58,4 +59,5 @@ exports.useChangePwd = useChangePwd;
58
59
  exports.useConfig = useConfig;
59
60
  exports.useRemember = useRemember;
60
61
  exports.useRowSelection = useRowSelection;
62
+ exports.AES = aes;
61
63
  exports.HmacSHA512 = hmacSHA512;
@@ -0,0 +1,7 @@
1
+ declare class AES {
2
+ salt: string;
3
+ constructor();
4
+ encrypt(value: string): string | undefined;
5
+ decrypt(value: string): string | undefined;
6
+ }
7
+ export default AES;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => {
5
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
+ return value;
7
+ };
8
+ const CryptoJS = require("crypto-js");
9
+ class AES {
10
+ constructor() {
11
+ __publicField(this, "salt", "SzlDJd#4202");
12
+ }
13
+ encrypt(value) {
14
+ if (!value) {
15
+ return;
16
+ }
17
+ const msg = typeof value === "string" ? value : JSON.stringify(value);
18
+ return CryptoJS.AES.encrypt(msg, this.salt).toString();
19
+ }
20
+ decrypt(value) {
21
+ if (!value) {
22
+ return;
23
+ }
24
+ return CryptoJS.AES.decrypt(value, this.salt).toString(CryptoJS.enc.Utf8);
25
+ }
26
+ }
27
+ module.exports = AES;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.2.22",
4
+ "version": "0.2.24",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "ahooks": "^3.7.4",
13
- "antd": "^5.12.2",
13
+ "antd": "^5.15.1",
14
14
  "crypto-js": "^4.2.0",
15
15
  "lodash": "^4.17.21",
16
16
  "react": "^18.2.0",