@pnt-team/pnt-component-frontend 0.0.45 → 0.0.51

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.
@@ -0,0 +1,4 @@
1
+ import { commonEesType } from "../utils/request";
2
+ import { BusinessGameInfoHighSecurityDecryptBody, BusinessGameInfoHighSecurityDecryptResponse, BusinessSelectListBody, BusinessSelectListResponse } from './types/index';
3
+ export declare const businessGameInfoHighSecurityDecrypt: (data: BusinessGameInfoHighSecurityDecryptBody) => Promise<commonEesType<BusinessGameInfoHighSecurityDecryptResponse>>;
4
+ export declare const businessSelectList: (data: BusinessSelectListBody) => Promise<commonEesType<BusinessSelectListResponse>>;
@@ -0,0 +1,46 @@
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/api/index.ts
30
+ var api_exports = {};
31
+ __export(api_exports, {
32
+ businessGameInfoHighSecurityDecrypt: () => businessGameInfoHighSecurityDecrypt,
33
+ businessSelectList: () => businessSelectList
34
+ });
35
+ module.exports = __toCommonJS(api_exports);
36
+ var import_request = __toESM(require("../utils/request"));
37
+ var businessGameInfoHighSecurityDecrypt = (data) => import_request.default.post(
38
+ "/api/v3/business/game_info/high-security-decrypt?audience=/laas-pnt",
39
+ data
40
+ );
41
+ var businessSelectList = (data) => import_request.default.post("/api/business/select/list", data);
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ businessGameInfoHighSecurityDecrypt,
45
+ businessSelectList
46
+ });
@@ -0,0 +1,80 @@
1
+ /**
2
+ * 本文件由 yapi-gen 自动生成,请勿手动修改
3
+ * 生成时间: 2026/9/10 11:19:01
4
+ * 数据来源: https://api-pnt.intlgame.com
5
+ */
6
+ export interface BusinessSelectListBody {
7
+ /** 业务接入类型:1-纯SDK,2-LI PASS,3-工作室品牌账号 */
8
+ business_access_method?: number;
9
+ /** 业务类型列表:1-正式业务,2-测试业务;SmartLink业务始终不返回 */
10
+ business_types?: number[];
11
+ /** 需要返回的字段;未传时使用场景默认字段,仅支持服务端白名单字段 */
12
+ fields?: string[];
13
+ /** 指定业务ID列表;与 Keyword 同时传���时取交集 */
14
+ game_ids?: string[];
15
+ /** 业务ID、中文名称或英文名称的模糊匹配关键字 */
16
+ keyword?: string;
17
+ /** 当前页 */
18
+ pageNum?: number;
19
+ /** 每页条数 */
20
+ pageSize?: number;
21
+ /** 下拉场景:default-通用业务,sdk-SDK定制,compliance_age-合规年龄,custom_region-自定义合规地域 */
22
+ scene?: string;
23
+ /** 业务状态列表:3-线上运营,4-接入中,5-中途结项,6-已下线 */
24
+ statuses?: number[];
25
+ /** 总条数 */
26
+ total?: number;
27
+ /** 总页数 */
28
+ totalPage?: number;
29
+ }
30
+ export interface BusinessSelectListResponseListItem {
31
+ /** 业务接入类型:1-纯SDK,2-LI PASS,3-工作室品牌账号 */
32
+ business_access_method?: number;
33
+ /** 业务类型:1-正式业务,2-测试业务 */
34
+ business_type?: number;
35
+ /** 当前场景是否可创建;仅 compliance_age、custom_region 场景有意义 */
36
+ creatable?: boolean;
37
+ /** 业务ID */
38
+ game_id?: string;
39
+ /** 业务接口开发负责人;SDK场景可返回 */
40
+ interface_developer_name?: string;
41
+ /** 业务中文名称 */
42
+ name?: string;
43
+ /** 业务英文名称 */
44
+ name_en?: string;
45
+ /** SDK定制版本通知人;SDK场景可返回 */
46
+ sdk_customize_notifier?: string;
47
+ /** 业务状态:3-线上运营,4-接入中,5-中途结项,6-已下线 */
48
+ state?: number;
49
+ }
50
+ export interface BusinessSelectListResponsePagination {
51
+ /** 当前页 */
52
+ pageNum?: number;
53
+ /** 每页条数 */
54
+ pageSize?: number;
55
+ /** 总条数 */
56
+ total?: number;
57
+ /** 总页数 */
58
+ totalPage?: number;
59
+ }
60
+ export interface BusinessSelectListResponse {
61
+ /** 业务列表;字段由请求 Fields 或场景默认字段决定 */
62
+ list?: BusinessSelectListResponseListItem[];
63
+ /** 分页信息;未分页时统计字段均为零值 */
64
+ pagination?: BusinessSelectListResponsePagination;
65
+ }
66
+ export interface BusinessGameInfoHighSecurityDecryptBodyParamItem {
67
+ /** 参数字段 */
68
+ key: string;
69
+ /** 参数密文 */
70
+ value: string;
71
+ }
72
+ export interface BusinessGameInfoHighSecurityDecryptBody {
73
+ param: BusinessGameInfoHighSecurityDecryptBodyParamItem[];
74
+ /** 页面ID */
75
+ page_id: string;
76
+ /** 请求环境 */
77
+ env: number;
78
+ game_id: number;
79
+ }
80
+ export type BusinessGameInfoHighSecurityDecryptResponse = Record<string, unknown>[];
@@ -0,0 +1,17 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/api/types/index.ts
16
+ var types_exports = {};
17
+ module.exports = __toCommonJS(types_exports);
@@ -1,21 +1,11 @@
1
- import type { BusinessSelectListBody, BusinessSelectListResponse } from "../../api/types";
2
- import type { commonEesType } from "../../utils/request";
3
1
  import React, { FC } from 'react';
4
2
  import type { SelectValue, TdSelectProps } from 'tdesign-react/es/select/type';
5
3
  import './index.scss';
6
- /** 业务列表请求函数:返回 commonEesType 结构,code === 0 视为成功 */
7
- export type BusinessSelectFetcher = (params: BusinessSelectListBody) => Promise<commonEesType<BusinessSelectListResponse>>;
8
4
  /** 下拉场景 */
9
5
  type Scene = 'default' | 'sdk' | 'compliance_age' | 'custom_region';
10
6
  /** 标签格式 */
11
7
  type LabelFormat = 'name' | 'name_en' | 'name_id' | 'name_en_id';
12
8
  interface PntBusinessSelectProps {
13
- /**
14
- * 业务列表请求函数
15
- * @description 不传时使用组件库内置的 `businessSelectList` API(对接 `/api/business/select/list`);
16
- * 需要覆盖时传入自定义请求函数(如各项目自己的 http 封装)
17
- */
18
- fetcher?: BusinessSelectFetcher;
19
9
  /**
20
10
  * 当前选中值
21
11
  * @description 单选为 string,多选为 string[]
@@ -118,8 +108,6 @@ interface PntBusinessSelectProps {
118
108
  * 业务选择器组件
119
109
  * @description 统一业务下拉选择器,内置对接后端通用接口 `/api/business/select/list`,
120
110
  * 支持远程搜索、滚动分页加载、多选、场景化禁用(合规场景 creatable 字段)。
121
- * 默认使用组件库内置 `businessSelectList` API,无需传 fetcher 即可工作;
122
- * 各项目如需覆盖请求逻辑,传入自定义 `fetcher` 即可。
123
111
  *
124
112
  * @param {PntBusinessSelectProps} props - 组件属性
125
113
  *
@@ -127,7 +115,7 @@ interface PntBusinessSelectProps {
127
115
  * ```tsx
128
116
  * import { PntBusinessSelect } from '@pnt-team/pnt-component-frontend';
129
117
  *
130
- * // 最简用法(内置 fetcher,无需传)
118
+ * // 最简用法
131
119
  * <PntBusinessSelect
132
120
  * value={gameId}
133
121
  * onChange={(v) => setGameId(v as string)}
@@ -156,14 +144,6 @@ interface PntBusinessSelectProps {
156
144
  * value={gameIds}
157
145
  * onChange={(v) => setGameIds(v as string[])}
158
146
  * />
159
- *
160
- * // 注入自定义 fetcher(覆盖内置 API)
161
- * import http from '@/utils/request';
162
- * <PntBusinessSelect
163
- * fetcher={(params) => http.post('/api/business/select/list', params)}
164
- * value={gameId}
165
- * onChange={(v) => setGameId(v as string)}
166
- * />
167
147
  * ```
168
148
  *
169
149
  * @returns {ReactElement} 业务选择器组件
@@ -29,7 +29,6 @@ var import_index = require("./index.scss");
29
29
  var import_jsx_runtime = require("react/jsx-runtime");
30
30
  var PntBusinessSelect = (props) => {
31
31
  const {
32
- fetcher,
33
32
  value,
34
33
  onChange,
35
34
  multiple = false,
@@ -52,8 +51,8 @@ var PntBusinessSelect = (props) => {
52
51
  style
53
52
  } = props;
54
53
  const requestFn = (0, import_react.useCallback)(
55
- (params) => (fetcher || import_api.businessSelectList)(params),
56
- [fetcher]
54
+ (params) => (0, import_api.businessSelectList)(params),
55
+ []
57
56
  );
58
57
  const [options, setOptions] = (0, import_react.useState)(
59
58
  []
@@ -1,4 +1,3 @@
1
- import { type HighSecurityFetcher } from "../../hooks/useHighSecurity";
2
1
  import React, { FC } from 'react';
3
2
  import './index.scss';
4
3
  interface PntSecureBoxProps {
@@ -39,19 +38,11 @@ interface PntSecureBoxProps {
39
38
  * @description 用于记录操作日志和权限验证
40
39
  */
41
40
  pageId?: string;
42
- /**
43
- * 高敏数据请求函数
44
- * @description 不传时使用组件库内置的 `businessGameInfoHighSecurityDecrypt` API
45
- * (对接 `/api/v3/business/game_info/high-security-decrypt`);
46
- * 需要覆盖时传入自定义请求函数(如各项目自己的 http 封装)
47
- */
48
- fetcher?: HighSecurityFetcher;
49
41
  }
50
42
  /**
51
43
  * 高敏信息展示统一组件
52
44
  * @description 用于统一处理和展示高敏信息,支持脱敏显示和按需获取真实数据。
53
- * 默认使用组件库内置 `businessGameInfoHighSecurityDecrypt` API,无需传 fetcher 即可工作;
54
- * 各项目如需覆盖请求逻辑,传入自定义 `fetcher` 即可。
45
+ * 内置对接组件库 `businessGameInfoHighSecurityDecrypt` API(`/api/v3/business/game_info/high-security-decrypt`)。
55
46
  *
56
47
  * @param {PntSecureBoxProps} props - 组件属性
57
48
  * @param {string} props.dataKey - 高敏信息的唯一标识 key
@@ -61,13 +52,11 @@ interface PntSecureBoxProps {
61
52
  * @param {(content: string) => React.ReactNode} props.renderDom - 自定义渲染函数
62
53
  * @param {string} [props.viewText] - 自定义查看按钮文案
63
54
  * @param {string} [props.pageId] - 页面 ID
64
- * @param {HighSecurityFetcher} [props.fetcher] - 高敏数据请求函数(可选,不传用内置 API)
65
55
  *
66
56
  * @example
67
57
  * ```tsx
68
58
  * import { PntSecureBox } from '@pnt-team/pnt-component-frontend';
69
59
  *
70
- * // 最简用法(内置 API,无需传 fetcher)
71
60
  * <PntSecureBox
72
61
  * dataKey="userPhone"
73
62
  * dataValue="_high_security_:AAAA...:6542"
@@ -76,17 +65,6 @@ interface PntSecureBoxProps {
76
65
  * renderDom={(content) => <span>{content}</span>}
77
66
  * viewText="查看"
78
67
  * />
79
- *
80
- * // 注入自定义 fetcher(覆盖内置 API)
81
- * import http from '@/utils/request';
82
- * <PntSecureBox
83
- * dataKey="userPhone"
84
- * dataValue="_high_security_:AAAA...:6542"
85
- * env={2}
86
- * gameId={12345}
87
- * fetcher={(params) => http.post('/api/v3/business/game_info/high-security-decrypt', params)}
88
- * renderDom={(content) => <span>{content}</span>}
89
- * />
90
68
  * ```
91
69
  *
92
70
  * @returns {ReactElement} 高敏信息展示组件
@@ -35,11 +35,9 @@ var PntSecureBox = (prop) => {
35
35
  gameId,
36
36
  renderDom,
37
37
  viewText,
38
- pageId,
39
- fetcher
38
+ pageId
40
39
  } = prop;
41
- const requestFn = fetcher || import_api.businessGameInfoHighSecurityDecrypt;
42
- const { securityData, requestSecurityData } = (0, import_useHighSecurity.useHighSecurity)(requestFn);
40
+ const { securityData, requestSecurityData } = (0, import_useHighSecurity.useHighSecurity)(import_api.businessGameInfoHighSecurityDecrypt);
43
41
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pnt-secure-box", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
44
42
  renderDom(
45
43
  (0, import_utils.isSecurityData)(dataValue) ? securityData[dataKey] || "******" : dataValue
@@ -0,0 +1,12 @@
1
+ declare const _default: {
2
+ development: {
3
+ API: string;
4
+ };
5
+ test: {
6
+ API: string;
7
+ };
8
+ production: {
9
+ API: string;
10
+ };
11
+ };
12
+ export default _default;
@@ -0,0 +1,39 @@
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/configs/host.ts
20
+ var host_exports = {};
21
+ __export(host_exports, {
22
+ default: () => host_default
23
+ });
24
+ module.exports = __toCommonJS(host_exports);
25
+ var host_default = {
26
+ development: {
27
+ // 开发环境接口请求
28
+ API: "/api"
29
+ },
30
+ test: {
31
+ // 测试环境接口地址
32
+ API: "http://43.134.150.67"
33
+ },
34
+ production: {
35
+ // 正式环境接口地址
36
+ API: "http://43.134.150.67"
37
+ // 任意ip即可, pnt主应用会自动替换,
38
+ }
39
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50SWQiOiJ1cy0xMDRmZTliNDZmZGY0NTM0YmU2NjNlYzllYWE5ZWEyZSIsImFjY291bnROYW1lIjoidl9id3dlaXdhbmciLCJleHAiOjE3ODkwNTIzODEsImV4cFRva2VuIjoxNzg5MDUxNTgxLCJqdGkiOiJjM2M3NDFiZC0wYzUwLTRlMGQtODUyNy1lMTFhMjljNTk0OGEifQ.9pXGqQeActEb2GOnrKQCkOgfyiUb2B8-uD3colfArdM";
2
+ export default _default;
@@ -0,0 +1,25 @@
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/configs/token.ts
20
+ var token_exports = {};
21
+ __export(token_exports, {
22
+ default: () => token_default
23
+ });
24
+ module.exports = __toCommonJS(token_exports);
25
+ var token_default = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50SWQiOiJ1cy0xMDRmZTliNDZmZGY0NTM0YmU2NjNlYzllYWE5ZWEyZSIsImFjY291bnROYW1lIjoidl9id3dlaXdhbmciLCJleHAiOjE3ODkwNTIzODEsImV4cFRva2VuIjoxNzg5MDUxNTgxLCJqdGkiOiJjM2M3NDFiZC0wYzUwLTRlMGQtODUyNy1lMTFhMjljNTk0OGEifQ.9pXGqQeActEb2GOnrKQCkOgfyiUb2B8-uD3colfArdM";
@@ -0,0 +1,8 @@
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;
@@ -0,0 +1,82 @@
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;
@@ -0,0 +1,4 @@
1
+ import { commonEesType } from "../utils/request";
2
+ import { BusinessGameInfoHighSecurityDecryptBody, BusinessGameInfoHighSecurityDecryptResponse, BusinessSelectListBody, BusinessSelectListResponse } from './types/index';
3
+ export declare const businessGameInfoHighSecurityDecrypt: (data: BusinessGameInfoHighSecurityDecryptBody) => Promise<commonEesType<BusinessGameInfoHighSecurityDecryptResponse>>;
4
+ export declare const businessSelectList: (data: BusinessSelectListBody) => Promise<commonEesType<BusinessSelectListResponse>>;
@@ -0,0 +1,11 @@
1
+ // src/api/index.ts
2
+ import axios from "../utils/request";
3
+ var businessGameInfoHighSecurityDecrypt = (data) => axios.post(
4
+ "/api/v3/business/game_info/high-security-decrypt?audience=/laas-pnt",
5
+ data
6
+ );
7
+ var businessSelectList = (data) => axios.post("/api/business/select/list", data);
8
+ export {
9
+ businessGameInfoHighSecurityDecrypt,
10
+ businessSelectList
11
+ };
@@ -0,0 +1,80 @@
1
+ /**
2
+ * 本文件由 yapi-gen 自动生成,请勿手动修改
3
+ * 生成时间: 2026/9/10 11:19:01
4
+ * 数据来源: https://api-pnt.intlgame.com
5
+ */
6
+ export interface BusinessSelectListBody {
7
+ /** 业务接入类型:1-纯SDK,2-LI PASS,3-工作室品牌账号 */
8
+ business_access_method?: number;
9
+ /** 业务类型列表:1-正式业务,2-测试业务;SmartLink业务始终不返回 */
10
+ business_types?: number[];
11
+ /** 需要返回的字段;未传时使用场景默认字段,仅支持服务端白名单字段 */
12
+ fields?: string[];
13
+ /** 指定业务ID列表;与 Keyword 同时传���时取交集 */
14
+ game_ids?: string[];
15
+ /** 业务ID、中文名称或英文名称的模糊匹配关键字 */
16
+ keyword?: string;
17
+ /** 当前页 */
18
+ pageNum?: number;
19
+ /** 每页条数 */
20
+ pageSize?: number;
21
+ /** 下拉场景:default-通用业务,sdk-SDK定制,compliance_age-合规年龄,custom_region-自定义合规地域 */
22
+ scene?: string;
23
+ /** 业务状态列表:3-线上运营,4-接入中,5-中途结项,6-已下线 */
24
+ statuses?: number[];
25
+ /** 总条数 */
26
+ total?: number;
27
+ /** 总页数 */
28
+ totalPage?: number;
29
+ }
30
+ export interface BusinessSelectListResponseListItem {
31
+ /** 业务接入类型:1-纯SDK,2-LI PASS,3-工作室品牌账号 */
32
+ business_access_method?: number;
33
+ /** 业务类型:1-正式业务,2-测试业务 */
34
+ business_type?: number;
35
+ /** 当前场景是否可创建;仅 compliance_age、custom_region 场景有意义 */
36
+ creatable?: boolean;
37
+ /** 业务ID */
38
+ game_id?: string;
39
+ /** 业务接口开发负责人;SDK场景可返回 */
40
+ interface_developer_name?: string;
41
+ /** 业务中文名称 */
42
+ name?: string;
43
+ /** 业务英文名称 */
44
+ name_en?: string;
45
+ /** SDK定制版本通知人;SDK场景可返回 */
46
+ sdk_customize_notifier?: string;
47
+ /** 业务状态:3-线上运营,4-接入中,5-中途结项,6-已下线 */
48
+ state?: number;
49
+ }
50
+ export interface BusinessSelectListResponsePagination {
51
+ /** 当前页 */
52
+ pageNum?: number;
53
+ /** 每页条数 */
54
+ pageSize?: number;
55
+ /** 总条数 */
56
+ total?: number;
57
+ /** 总页数 */
58
+ totalPage?: number;
59
+ }
60
+ export interface BusinessSelectListResponse {
61
+ /** 业务列表;字段由请求 Fields 或场景默认字段决定 */
62
+ list?: BusinessSelectListResponseListItem[];
63
+ /** 分页信息;未分页时统计字段均为零值 */
64
+ pagination?: BusinessSelectListResponsePagination;
65
+ }
66
+ export interface BusinessGameInfoHighSecurityDecryptBodyParamItem {
67
+ /** 参数字段 */
68
+ key: string;
69
+ /** 参数密文 */
70
+ value: string;
71
+ }
72
+ export interface BusinessGameInfoHighSecurityDecryptBody {
73
+ param: BusinessGameInfoHighSecurityDecryptBodyParamItem[];
74
+ /** 页面ID */
75
+ page_id: string;
76
+ /** 请求环境 */
77
+ env: number;
78
+ game_id: number;
79
+ }
80
+ export type BusinessGameInfoHighSecurityDecryptResponse = Record<string, unknown>[];
File without changes
@@ -1,21 +1,11 @@
1
- import type { BusinessSelectListBody, BusinessSelectListResponse } from "../../api/types";
2
- import type { commonEesType } from "../../utils/request";
3
1
  import React, { FC } from 'react';
4
2
  import type { SelectValue, TdSelectProps } from 'tdesign-react/es/select/type';
5
3
  import './index.scss';
6
- /** 业务列表请求函数:返回 commonEesType 结构,code === 0 视为成功 */
7
- export type BusinessSelectFetcher = (params: BusinessSelectListBody) => Promise<commonEesType<BusinessSelectListResponse>>;
8
4
  /** 下拉场景 */
9
5
  type Scene = 'default' | 'sdk' | 'compliance_age' | 'custom_region';
10
6
  /** 标签格式 */
11
7
  type LabelFormat = 'name' | 'name_en' | 'name_id' | 'name_en_id';
12
8
  interface PntBusinessSelectProps {
13
- /**
14
- * 业务列表请求函数
15
- * @description 不传时使用组件库内置的 `businessSelectList` API(对接 `/api/business/select/list`);
16
- * 需要覆盖时传入自定义请求函数(如各项目自己的 http 封装)
17
- */
18
- fetcher?: BusinessSelectFetcher;
19
9
  /**
20
10
  * 当前选中值
21
11
  * @description 单选为 string,多选为 string[]
@@ -118,8 +108,6 @@ interface PntBusinessSelectProps {
118
108
  * 业务选择器组件
119
109
  * @description 统一业务下拉选择器,内置对接后端通用接口 `/api/business/select/list`,
120
110
  * 支持远程搜索、滚动分页加载、多选、场景化禁用(合规场景 creatable 字段)。
121
- * 默认使用组件库内置 `businessSelectList` API,无需传 fetcher 即可工作;
122
- * 各项目如需覆盖请求逻辑,传入自定义 `fetcher` 即可。
123
111
  *
124
112
  * @param {PntBusinessSelectProps} props - 组件属性
125
113
  *
@@ -127,7 +115,7 @@ interface PntBusinessSelectProps {
127
115
  * ```tsx
128
116
  * import { PntBusinessSelect } from '@pnt-team/pnt-component-frontend';
129
117
  *
130
- * // 最简用法(内置 fetcher,无需传)
118
+ * // 最简用法
131
119
  * <PntBusinessSelect
132
120
  * value={gameId}
133
121
  * onChange={(v) => setGameId(v as string)}
@@ -156,14 +144,6 @@ interface PntBusinessSelectProps {
156
144
  * value={gameIds}
157
145
  * onChange={(v) => setGameIds(v as string[])}
158
146
  * />
159
- *
160
- * // 注入自定义 fetcher(覆盖内置 API)
161
- * import http from '@/utils/request';
162
- * <PntBusinessSelect
163
- * fetcher={(params) => http.post('/api/business/select/list', params)}
164
- * value={gameId}
165
- * onChange={(v) => setGameId(v as string)}
166
- * />
167
147
  * ```
168
148
  *
169
149
  * @returns {ReactElement} 业务选择器组件
@@ -12,7 +12,6 @@ import "./index.scss";
12
12
  import { jsx } from "react/jsx-runtime";
13
13
  var PntBusinessSelect = (props) => {
14
14
  const {
15
- fetcher,
16
15
  value,
17
16
  onChange,
18
17
  multiple = false,
@@ -35,8 +34,8 @@ var PntBusinessSelect = (props) => {
35
34
  style
36
35
  } = props;
37
36
  const requestFn = useCallback(
38
- (params) => (fetcher || businessSelectList)(params),
39
- [fetcher]
37
+ (params) => businessSelectList(params),
38
+ []
40
39
  );
41
40
  const [options, setOptions] = useState(
42
41
  []