@pnt-team/pnt-component-frontend 0.0.35 → 0.0.36

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.
Files changed (77) hide show
  1. package/README.md +71 -64
  2. package/package.json +8 -2
  3. package/lib/cjs/api/index.d.ts +0 -17
  4. package/lib/cjs/api/index.js +0 -45
  5. package/lib/cjs/assets/css/tdesign-theme.css +0 -584
  6. package/lib/cjs/assets/images/uploadImg.png +0 -0
  7. package/lib/cjs/assets/svg/inputSearch.svg +0 -4
  8. package/lib/cjs/assets/svg/inputTip.svg +0 -5
  9. package/lib/cjs/assets/svg/inputWarnTip.svg +0 -5
  10. package/lib/cjs/components/PntCopyData/index.d.ts +0 -91
  11. package/lib/cjs/components/PntCopyData/index.js +0 -81
  12. package/lib/cjs/components/PntCopyData/index.scss +0 -5
  13. package/lib/cjs/components/PntImagePreview/index.d.ts +0 -75
  14. package/lib/cjs/components/PntImagePreview/index.js +0 -91
  15. package/lib/cjs/components/PntImagePreview/index.scss +0 -54
  16. package/lib/cjs/components/PntSecureBox/index.d.ts +0 -69
  17. package/lib/cjs/components/PntSecureBox/index.js +0 -65
  18. package/lib/cjs/components/PntSecureBox/index.scss +0 -19
  19. package/lib/cjs/configs/host.d.ts +0 -12
  20. package/lib/cjs/configs/host.js +0 -39
  21. package/lib/cjs/configs/token.d.ts +0 -2
  22. package/lib/cjs/configs/token.js +0 -25
  23. package/lib/cjs/global.d.ts +0 -30
  24. package/lib/cjs/hooks/useBtnPermission.d.ts +0 -67
  25. package/lib/cjs/hooks/useBtnPermission.js +0 -57
  26. package/lib/cjs/hooks/useHighSecurity.d.ts +0 -6
  27. package/lib/cjs/hooks/useHighSecurity.js +0 -51
  28. package/lib/cjs/hooks/useOsPlatformList.d.ts +0 -68
  29. package/lib/cjs/hooks/useOsPlatformList.js +0 -104
  30. package/lib/cjs/hooks/usePagination.d.ts +0 -72
  31. package/lib/cjs/hooks/usePagination.js +0 -71
  32. package/lib/cjs/index.d.ts +0 -10
  33. package/lib/cjs/utils/const.d.ts +0 -13
  34. package/lib/cjs/utils/const.js +0 -51
  35. package/lib/cjs/utils/index.d.ts +0 -6
  36. package/lib/cjs/utils/index.js +0 -43
  37. package/lib/cjs/utils/request.d.ts +0 -8
  38. package/lib/cjs/utils/request.js +0 -82
  39. package/lib/esm/api/index.d.ts +0 -17
  40. package/lib/esm/api/index.js +0 -11
  41. package/lib/esm/assets/css/tdesign-theme.css +0 -584
  42. package/lib/esm/assets/images/uploadImg.png +0 -0
  43. package/lib/esm/assets/svg/inputSearch.svg +0 -4
  44. package/lib/esm/assets/svg/inputTip.svg +0 -5
  45. package/lib/esm/assets/svg/inputWarnTip.svg +0 -5
  46. package/lib/esm/components/PntCopyData/index.d.ts +0 -91
  47. package/lib/esm/components/PntCopyData/index.js +0 -51
  48. package/lib/esm/components/PntCopyData/index.scss +0 -5
  49. package/lib/esm/components/PntImagePreview/index.d.ts +0 -75
  50. package/lib/esm/components/PntImagePreview/index.js +0 -61
  51. package/lib/esm/components/PntImagePreview/index.scss +0 -54
  52. package/lib/esm/components/PntSecureBox/index.d.ts +0 -69
  53. package/lib/esm/components/PntSecureBox/index.js +0 -35
  54. package/lib/esm/components/PntSecureBox/index.scss +0 -19
  55. package/lib/esm/configs/host.d.ts +0 -12
  56. package/lib/esm/configs/host.js +0 -19
  57. package/lib/esm/configs/token.d.ts +0 -2
  58. package/lib/esm/configs/token.js +0 -5
  59. package/lib/esm/global.d.ts +0 -30
  60. package/lib/esm/hooks/useBtnPermission.d.ts +0 -67
  61. package/lib/esm/hooks/useBtnPermission.js +0 -31
  62. package/lib/esm/hooks/useHighSecurity.d.ts +0 -6
  63. package/lib/esm/hooks/useHighSecurity.js +0 -27
  64. package/lib/esm/hooks/useOsPlatformList.d.ts +0 -68
  65. package/lib/esm/hooks/useOsPlatformList.js +0 -68
  66. package/lib/esm/hooks/usePagination.d.ts +0 -72
  67. package/lib/esm/hooks/usePagination.js +0 -47
  68. package/lib/esm/index.d.ts +0 -10
  69. package/lib/esm/index.js +0 -17
  70. package/lib/esm/utils/const.d.ts +0 -13
  71. package/lib/esm/utils/const.js +0 -26
  72. package/lib/esm/utils/index.d.ts +0 -6
  73. package/lib/esm/utils/index.js +0 -19
  74. package/lib/esm/utils/request.d.ts +0 -8
  75. package/lib/esm/utils/request.js +0 -52
  76. package/lib/umd/pnt-component-frontend.min.css +0 -1
  77. package/lib/umd/pnt-component-frontend.min.js +0 -1
@@ -1,57 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/hooks/useBtnPermission.ts
20
- var useBtnPermission_exports = {};
21
- __export(useBtnPermission_exports, {
22
- DEMO_GAME_TYPE_KEY: () => DEMO_GAME_TYPE_KEY,
23
- NO_PERMISSION_MANNER_KEY: () => NO_PERMISSION_MANNER_KEY,
24
- default: () => useBtnPermission_default,
25
- useBtnPermission: () => useBtnPermission
26
- });
27
- module.exports = __toCommonJS(useBtnPermission_exports);
28
- var import_react = require("react");
29
- var DEMO_GAME_TYPE_KEY = "0";
30
- var NO_PERMISSION_MANNER_KEY = "no_permission_manner";
31
- var useBtnPermission = (options = {}) => {
32
- const { permissions, demoGame, serviceInfo } = options;
33
- const isDemoGame = (0, import_react.useMemo)(() => {
34
- if (!demoGame || !serviceInfo)
35
- return false;
36
- return serviceInfo.serviceType === demoGame.id && serviceInfo.serviceName === demoGame.name;
37
- }, [demoGame, serviceInfo]);
38
- const getBtnPermission = (0, import_react.useCallback)(
39
- (type, key, defaultValue = 1) => {
40
- var _a, _b, _c, _d, _e;
41
- return (_e = (_d = (_c = (_a = permissions == null ? void 0 : permissions[isDemoGame ? DEMO_GAME_TYPE_KEY : type]) == null ? void 0 : _a[key]) != null ? _c : (_b = permissions == null ? void 0 : permissions[NO_PERMISSION_MANNER_KEY]) == null ? void 0 : _b[key]) != null ? _d : defaultValue) != null ? _e : 1;
42
- },
43
- [permissions, isDemoGame]
44
- );
45
- return {
46
- btnPermission: permissions,
47
- isDemoGame,
48
- getBtnPermission
49
- };
50
- };
51
- var useBtnPermission_default = useBtnPermission;
52
- // Annotate the CommonJS export names for ESM import in node:
53
- 0 && (module.exports = {
54
- DEMO_GAME_TYPE_KEY,
55
- NO_PERMISSION_MANNER_KEY,
56
- useBtnPermission
57
- });
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const useHighSecurity: () => {
3
- securityData: any;
4
- setSecurityData: import("react").Dispatch<any>;
5
- requestSecurityData: ({ gameId, param, env }: any) => Promise<void>;
6
- };
@@ -1,51 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/hooks/useHighSecurity.ts
20
- var useHighSecurity_exports = {};
21
- __export(useHighSecurity_exports, {
22
- useHighSecurity: () => useHighSecurity
23
- });
24
- module.exports = __toCommonJS(useHighSecurity_exports);
25
- var import_api = require("../api");
26
- var import_react = require("react");
27
- var useHighSecurity = () => {
28
- const [securityData, setSecurityData] = (0, import_react.useState)({});
29
- const requestSecurityData = async ({ gameId, param, env }) => {
30
- var _a;
31
- const { ret, data } = await (0, import_api.highSecurity)({
32
- env: Number(env),
33
- game_id: Number(gameId),
34
- page_id: location.pathname,
35
- param
36
- });
37
- if (ret === 0) {
38
- securityData[param == null ? void 0 : param[0].key] = (_a = data == null ? void 0 : data[0]) == null ? void 0 : _a.value;
39
- setSecurityData({ ...securityData });
40
- }
41
- };
42
- return {
43
- securityData,
44
- setSecurityData,
45
- requestSecurityData
46
- };
47
- };
48
- // Annotate the CommonJS export names for ESM import in node:
49
- 0 && (module.exports = {
50
- useHighSecurity
51
- });
@@ -1,68 +0,0 @@
1
- import { commonEesType } from '../utils/request';
2
- /** OS 平台数据类型定义 */
3
- export interface OsItem {
4
- id: number;
5
- os_name: string;
6
- sdk_name: string;
7
- status: number;
8
- platform_id: number;
9
- }
10
- export interface PlatformItem {
11
- id: number;
12
- platform_name_zh: string;
13
- platform_name_en: string;
14
- status: number;
15
- }
16
- export interface OsPlatformData {
17
- os_list: OsItem[];
18
- platform_list: PlatformItem[];
19
- }
20
- /** OS/平台列表请求函数:返回与 src/utils/request 响应拦截器解析后的结构一致({ code, msg, data }) */
21
- export type OsPlatformFetcher = () => Promise<commonEesType<OsPlatformData>>;
22
- /**
23
- * 默认 fetcher:基于 src/utils/request 请求 OS/平台枚举接口。
24
- * 与源项目 account-business-frontend 的 getOsPlatformList 接口路径一致;
25
- * audience 参数由 request 拦截器自动补齐。
26
- */
27
- export declare const defaultOsPlatformFetcher: OsPlatformFetcher;
28
- /**
29
- * 清除缓存(用于极少数需要强制刷新的场景,如后台更新了平台列表后)。
30
- * @param fetcher 指定要清除的 fetcher;不传则清除全部缓存
31
- */
32
- export declare const clearOsPlatformListCache: (fetcher?: OsPlatformFetcher) => void;
33
- /**
34
- * OS/平台列表 Hook(L3 业务 Hook)
35
- *
36
- * 拉取 OS 与平台枚举数据并做模块级缓存,整个会话只请求一次;
37
- * 并发调用共享同一个进行中的请求。
38
- *
39
- * 零业务侵入:数据接口通过 fetcher 注入,不传时使用内置默认 fetcher
40
- * (基于 src/utils/request 请求 /api/internal/business/manage/osPlatformList)。
41
- *
42
- * @param fetcher 自定义请求函数,需返回 { code, msg, data } 结构且 code === 0 视为成功
43
- * @returns osPlatformList OS/平台数据,请求完成或命中缓存前为 undefined
44
- *
45
- * @example
46
- * ```tsx
47
- * import { useOsPlatformList } from '@pnt/business-components';
48
- *
49
- * const Demo = () => {
50
- * const { osPlatformList } = useOsPlatformList();
51
- * // 或注入自定义 fetcher(建议用 useCallback 保持引用稳定)
52
- * // const { osPlatformList } = useOsPlatformList(() => http.get('/my/os/platform'));
53
- *
54
- * return (
55
- * <Select
56
- * options={osPlatformList?.platform_list.map((p) => ({
57
- * label: p.platform_name_zh,
58
- * value: p.id,
59
- * }))}
60
- * />
61
- * );
62
- * };
63
- * ```
64
- */
65
- export declare const useOsPlatformList: (fetcher?: OsPlatformFetcher) => {
66
- osPlatformList: OsPlatformData | undefined;
67
- };
68
- export default useOsPlatformList;
@@ -1,104 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/hooks/useOsPlatformList.ts
30
- var useOsPlatformList_exports = {};
31
- __export(useOsPlatformList_exports, {
32
- clearOsPlatformListCache: () => clearOsPlatformListCache,
33
- default: () => useOsPlatformList_default,
34
- defaultOsPlatformFetcher: () => defaultOsPlatformFetcher,
35
- useOsPlatformList: () => useOsPlatformList
36
- });
37
- module.exports = __toCommonJS(useOsPlatformList_exports);
38
- var import_react = require("react");
39
- var import_request = __toESM(require("../utils/request"));
40
- var defaultOsPlatformFetcher = () => import_request.default.get("/api/internal/business/manage/osPlatformList");
41
- var cacheMap = /* @__PURE__ */ new Map();
42
- var fetchOsPlatformList = async (fetcher) => {
43
- const cached = cacheMap.get(fetcher);
44
- if (cached == null ? void 0 : cached.data)
45
- return cached.data;
46
- if (cached == null ? void 0 : cached.pending)
47
- return cached.pending;
48
- const pending = (async () => {
49
- try {
50
- const res = await fetcher();
51
- if (res.code === 0) {
52
- cacheMap.set(fetcher, { data: res.data });
53
- return res.data;
54
- }
55
- return void 0;
56
- } finally {
57
- const entry = cacheMap.get(fetcher);
58
- cacheMap.set(fetcher, { data: entry == null ? void 0 : entry.data });
59
- }
60
- })();
61
- cacheMap.set(fetcher, { data: cached == null ? void 0 : cached.data, pending });
62
- return pending;
63
- };
64
- var clearOsPlatformListCache = (fetcher) => {
65
- if (fetcher) {
66
- cacheMap.delete(fetcher);
67
- } else {
68
- cacheMap.clear();
69
- }
70
- };
71
- var useOsPlatformList = (fetcher = defaultOsPlatformFetcher) => {
72
- const [osPlatformList, setOsPlatformList] = (0, import_react.useState)(
73
- () => {
74
- var _a;
75
- return (_a = cacheMap.get(fetcher)) == null ? void 0 : _a.data;
76
- }
77
- );
78
- (0, import_react.useEffect)(() => {
79
- var _a;
80
- const cached = (_a = cacheMap.get(fetcher)) == null ? void 0 : _a.data;
81
- if (cached) {
82
- setOsPlatformList(cached);
83
- return;
84
- }
85
- let mounted = true;
86
- fetchOsPlatformList(fetcher).then((data) => {
87
- if (mounted && data)
88
- setOsPlatformList(data);
89
- });
90
- return () => {
91
- mounted = false;
92
- };
93
- }, [fetcher]);
94
- return {
95
- osPlatformList
96
- };
97
- };
98
- var useOsPlatformList_default = useOsPlatformList;
99
- // Annotate the CommonJS export names for ESM import in node:
100
- 0 && (module.exports = {
101
- clearOsPlatformListCache,
102
- defaultOsPlatformFetcher,
103
- useOsPlatformList
104
- });
@@ -1,72 +0,0 @@
1
- /// <reference types="react" />
2
- import type { PaginationProps } from 'tdesign-react';
3
- /** 分页内部状态 */
4
- export interface PaginationData {
5
- /** 当前页码(从 1 开始) */
6
- currentPage: number;
7
- /** 数据总条数 */
8
- totalCount: number;
9
- /** 总页数 */
10
- totalPage: number;
11
- /** 每页条数 */
12
- pageSize: number;
13
- }
14
- /** 分页变化时回传给外部请求的参数 */
15
- export interface PaginationRequestParams {
16
- /** 页码(从 1 开始) */
17
- pageNumber: number;
18
- /** 每页条数 */
19
- pageSize: number;
20
- }
21
- /** 分页变化回调 */
22
- export type OnPaginationRequest = (params: PaginationRequestParams) => void;
23
- /**
24
- * 分页 Hook(L3 业务 Hook)
25
- *
26
- * 维护分页状态,并在页码 / 每页条数变化时通过 onPaginationRequest 回调通知外部发起请求。
27
- * 请求完成后由外部调用 setPaginationData 回写最新分页数据。
28
- *
29
- * 特性:
30
- * - totalCount 为 0 时 paginationProps 返回 undefined,可直接透传给 tdesign-react 的 Pagination 组件(不渲染分页器);
31
- * - 切换每页条数时自动回到第 1 页;
32
- * - 返回的 paginationProps 可直接展开到 <Pagination {...paginationProps} />。
33
- *
34
- * @param onPaginationRequest 页码或每页条数变化时的回调,外部在此发起列表请求
35
- * @returns paginationData 分页数据;setPaginationData 回写分页数据;paginationProps tdesign-react Pagination 组件属性(totalCount 为 0 时为 undefined)
36
- *
37
- * @example
38
- * ```tsx
39
- * import { Pagination } from 'tdesign-react';
40
- * import { usePagination } from '@pnt/business-components';
41
- *
42
- * const Demo = () => {
43
- * const [list, setList] = useState<Item[]>([]);
44
- * const { paginationData, setPaginationData, paginationProps } = usePagination(
45
- * async ({ pageNumber, pageSize }) => {
46
- * const res = await fetchList({ page: pageNumber, size: pageSize });
47
- * setList(res.data.list);
48
- * setPaginationData((prev) => ({
49
- * ...prev,
50
- * currentPage: pageNumber,
51
- * pageSize,
52
- * totalCount: res.data.total,
53
- * totalPage: Math.ceil(res.data.total / pageSize),
54
- * }));
55
- * },
56
- * );
57
- *
58
- * return (
59
- * <>
60
- * <Table data={list} />
61
- * {paginationProps && <Pagination {...paginationProps} />}
62
- * </>
63
- * );
64
- * };
65
- * ```
66
- */
67
- export declare const usePagination: (onPaginationRequest: OnPaginationRequest) => {
68
- paginationData: PaginationData;
69
- setPaginationData: import("react").Dispatch<import("react").SetStateAction<PaginationData>>;
70
- paginationProps: PaginationProps | undefined;
71
- };
72
- export default usePagination;
@@ -1,71 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/hooks/usePagination.ts
20
- var usePagination_exports = {};
21
- __export(usePagination_exports, {
22
- default: () => usePagination_default,
23
- usePagination: () => usePagination
24
- });
25
- module.exports = __toCommonJS(usePagination_exports);
26
- var import_react = require("react");
27
- var usePagination = (onPaginationRequest) => {
28
- const [paginationData, setPaginationData] = (0, import_react.useState)({
29
- currentPage: 1,
30
- totalCount: 0,
31
- totalPage: 0,
32
- pageSize: 10
33
- });
34
- const handleCurrentChange = (0, import_react.useCallback)(
35
- (current, pageInfo) => {
36
- onPaginationRequest({
37
- pageNumber: current,
38
- pageSize: pageInfo.pageSize
39
- });
40
- },
41
- [onPaginationRequest]
42
- );
43
- const handlePageSizeChange = (0, import_react.useCallback)(
44
- (pageSize) => {
45
- onPaginationRequest({ pageNumber: 1, pageSize });
46
- },
47
- [onPaginationRequest]
48
- );
49
- const paginationProps = (0, import_react.useMemo)(() => {
50
- if (paginationData.totalCount === 0)
51
- return void 0;
52
- return {
53
- pageSizeOptions: [10, 20, 30, 50, 100],
54
- pageSize: paginationData.pageSize,
55
- current: paginationData.currentPage,
56
- total: paginationData.totalCount,
57
- onCurrentChange: handleCurrentChange,
58
- onPageSizeChange: handlePageSizeChange
59
- };
60
- }, [paginationData, handleCurrentChange, handlePageSizeChange]);
61
- return {
62
- paginationData,
63
- setPaginationData,
64
- paginationProps
65
- };
66
- };
67
- var usePagination_default = usePagination;
68
- // Annotate the CommonJS export names for ESM import in node:
69
- 0 && (module.exports = {
70
- usePagination
71
- });
@@ -1,10 +0,0 @@
1
- export { default as PntCopyData } from './components/PntCopyData';
2
- export { default as PntImagePreview } from './components/PntImagePreview';
3
- export { default as PntSecureBox } from './components/PntSecureBox';
4
- export { default as useBtnPermission } from './hooks/useBtnPermission';
5
- export { useHighSecurity } from './hooks/useHighSecurity';
6
- export { default as useOsPlatformList } from './hooks/useOsPlatformList';
7
- export { default as usePagination } from './hooks/usePagination';
8
- export type { BtnPermissionMap, UseBtnPermissionOptions } from './hooks/useBtnPermission';
9
- export type { OsPlatformData, OsPlatformFetcher } from './hooks/useOsPlatformList';
10
- export type { PaginationData, PaginationRequestParams, OnPaginationRequest } from './hooks/usePagination';
@@ -1,13 +0,0 @@
1
- export declare const SUB_APP_PATHNAME: {
2
- ACCOUNT: string;
3
- SDK: string;
4
- NOTICE: string;
5
- CONFIGFROM: string;
6
- CONFIGTHEME: string;
7
- REVIEWLIST: string;
8
- INTERNALTOOLS: string;
9
- REPORTS: string;
10
- };
11
- export declare const AUDIENCE_MAPPING: {
12
- [x: string]: string;
13
- };
@@ -1,51 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/utils/const.ts
20
- var const_exports = {};
21
- __export(const_exports, {
22
- AUDIENCE_MAPPING: () => AUDIENCE_MAPPING,
23
- SUB_APP_PATHNAME: () => SUB_APP_PATHNAME
24
- });
25
- module.exports = __toCommonJS(const_exports);
26
- var SUB_APP_PATHNAME = {
27
- ACCOUNT: "/laas",
28
- SDK: "/intlsdk",
29
- NOTICE: "/notice",
30
- CONFIGFROM: "/configform",
31
- CONFIGTHEME: "/configtheme",
32
- REVIEWLIST: "/approvalservices",
33
- INTERNALTOOLS: "/internaltools",
34
- REPORTS: "/reports"
35
- };
36
- var audienceSuffix = "-pnt";
37
- var AUDIENCE_MAPPING = {
38
- [SUB_APP_PATHNAME.ACCOUNT]: `/laas${audienceSuffix}`,
39
- [SUB_APP_PATHNAME.SDK]: `/intl-sdk${audienceSuffix}`,
40
- [SUB_APP_PATHNAME.NOTICE]: `/notice${audienceSuffix}`,
41
- [SUB_APP_PATHNAME.CONFIGFROM]: `/configform${audienceSuffix}`,
42
- [SUB_APP_PATHNAME.CONFIGTHEME]: `/configtheme${audienceSuffix}`,
43
- [SUB_APP_PATHNAME.REVIEWLIST]: `/approval-services${audienceSuffix}`,
44
- [SUB_APP_PATHNAME.INTERNALTOOLS]: `/internaltools${audienceSuffix}`,
45
- [SUB_APP_PATHNAME.REPORTS]: `/reports${audienceSuffix}`
46
- };
47
- // Annotate the CommonJS export names for ESM import in node:
48
- 0 && (module.exports = {
49
- AUDIENCE_MAPPING,
50
- SUB_APP_PATHNAME
51
- });
@@ -1,6 +0,0 @@
1
- /**
2
- * 判断是否是高敏信息逻辑
3
- * @param {*} val
4
- * @returns
5
- */
6
- export declare const isSecurityData: (val: string | number) => boolean;
@@ -1,43 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/utils/index.ts
20
- var utils_exports = {};
21
- __export(utils_exports, {
22
- isSecurityData: () => isSecurityData
23
- });
24
- module.exports = __toCommonJS(utils_exports);
25
- var isSecurityData = (val) => {
26
- const str = String(val);
27
- if (!str.includes("_high_security_:"))
28
- return false;
29
- const rsp = str.split(":");
30
- const calcStr = rsp.slice(0, -1).join(":");
31
- const calcNum = parseInt(rsp[rsp.length - 1], 10);
32
- if (isNaN(calcNum))
33
- return false;
34
- let num = 0;
35
- for (const item of calcStr) {
36
- num += item.charCodeAt(0);
37
- }
38
- return num === calcNum;
39
- };
40
- // Annotate the CommonJS export names for ESM import in node:
41
- 0 && (module.exports = {
42
- isSecurityData
43
- });
@@ -1,8 +0,0 @@
1
- export interface commonEesType<T> {
2
- code: number;
3
- msg: string;
4
- data: T;
5
- ret?: number;
6
- }
7
- declare const http: import("axios").AxiosInstance;
8
- export default http;
@@ -1,82 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/utils/request.ts
30
- var request_exports = {};
31
- __export(request_exports, {
32
- default: () => request_default
33
- });
34
- module.exports = __toCommonJS(request_exports);
35
- var import_axios = __toESM(require("axios"));
36
- var import_host = __toESM(require("../configs/host"));
37
- var import_token = __toESM(require("../configs/token"));
38
- var import_const = require("./const");
39
- var env = process.env.MODE || "development";
40
- var API_HOST = import_host.default[env].API;
41
- var http = import_axios.default.create({
42
- baseURL: API_HOST,
43
- timeout: 100 * 1e3,
44
- withCredentials: true
45
- });
46
- http.interceptors.request.use(
47
- (config) => {
48
- var _a;
49
- const conf = { ...config };
50
- const matchPath = Object.values(import_const.SUB_APP_PATHNAME).filter(
51
- (path) => window.location.pathname.includes(path)
52
- )[0] || "";
53
- if (process.env.NODE_ENV === "development") {
54
- conf.baseURL = matchPath ? "/subapi" : conf.baseURL;
55
- conf.headers["X-Service-Type"] = ((_a = conf.headers) == null ? void 0 : _a["x-service-type"]) || "11";
56
- conf.headers["X-User-Id"] = "us-104fe9b46fdf4534be663ec9eaa9ea2e";
57
- conf.headers["X-User-Name"] = "v_bwweiwang";
58
- conf.headers.authorization = import_token.default;
59
- } else {
60
- conf.baseURL = "/";
61
- }
62
- if (!conf.url.includes("audience=")) {
63
- conf.url = `${conf.url}?audience=${matchPath ? import_const.AUDIENCE_MAPPING[matchPath] : "/player-network"}`;
64
- }
65
- return conf;
66
- },
67
- (err) => Promise.reject(err)
68
- );
69
- http.interceptors.response.use(
70
- (response) => {
71
- if (response.status === 200) {
72
- const { data } = response;
73
- if (data.code === 0) {
74
- return Promise.resolve(data);
75
- }
76
- return Promise.resolve(data);
77
- }
78
- return Promise.reject(response == null ? void 0 : response.data);
79
- },
80
- (e) => Promise.reject(e)
81
- );
82
- var request_default = http;
@@ -1,17 +0,0 @@
1
- import { commonEesType } from "../utils/request";
2
- /**
3
- * 高敏信息解密
4
- * @returns
5
- */
6
- interface SecurityItem {
7
- key: string;
8
- value: string;
9
- }
10
- /**
11
- * 对数据进行高安全解密处理
12
- *
13
- * @param data 需要解密的数据
14
- * @returns 解密后的数据
15
- */
16
- export declare function highSecurity(data: any): Promise<commonEesType<SecurityItem[]>>;
17
- export {};