@gct-paas/api 0.1.6-dev.1 → 0.1.6-dev.11

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 (35) hide show
  1. package/dist/index.esm.min.js +1 -1
  2. package/es/apaas/service/api-config.mjs +103 -4
  3. package/es/apaas/service/apis/api.service.d.ts +2 -1
  4. package/es/apaas/service/apis/app-global-settings.service.d.ts +4 -0
  5. package/es/apaas/service/apis/app-org.service.d.ts +4 -0
  6. package/es/apaas/service/apis/category.service.d.ts +0 -8
  7. package/es/apaas/service/apis/chat.service.d.ts +2 -1
  8. package/es/apaas/service/apis/detail-page.service.d.ts +96 -0
  9. package/es/apaas/service/apis/edhr-instance.service.d.ts +4 -8
  10. package/es/apaas/service/apis/excel.service.d.ts +4 -2
  11. package/es/apaas/service/apis/medPro.service.d.ts +108 -0
  12. package/es/apaas/service/apis/online-form-instance.service.d.ts +4 -12
  13. package/es/apaas/service/apis/online-form-tmpl.service.d.ts +18 -1
  14. package/es/apaas/service/apis/ss.service.d.ts +9 -0
  15. package/es/apaas/service/apis/transaction.service.d.ts +157 -0
  16. package/es/apaas/service/apis/user.service.d.ts +31 -0
  17. package/es/apaas/service/entities.d.ts +24 -37
  18. package/es/platform/service/api-config.mjs +10 -4
  19. package/es/platform/service/apis/api.service.d.ts +10 -1
  20. package/es/platform/service/apis/app.service.d.ts +4 -0
  21. package/es/platform/service/apis/dashboard.service.d.ts +0 -4
  22. package/es/platform/service/apis/license.service.d.ts +12 -2
  23. package/es/platform/service/apis/org.service.d.ts +0 -4
  24. package/es/platform/service/apis/plugin.service.d.ts +2 -1
  25. package/es/platform/service/apis/tenant.service.d.ts +0 -4
  26. package/es/platform/service/entities.d.ts +0 -1
  27. package/es/service/index.mjs +0 -2
  28. package/es/types/index.d.ts +8 -0
  29. package/es/utils/index.d.ts +0 -1
  30. package/es/utils/index.mjs +0 -1
  31. package/package.json +4 -4
  32. package/es/service/request.client.d.ts +0 -6
  33. package/es/service/request.client.mjs +0 -35
  34. package/es/utils/native-http/native-http.d.ts +0 -6
  35. package/es/utils/native-http/native-http.mjs +0 -63
@@ -0,0 +1,157 @@
1
+ import type { AxiosRequestConfig } from 'axios';
2
+ import type {
3
+ TransactionRequest,
4
+ TransactionResponse,
5
+ TransactionDTO,
6
+ } from '../entities';
7
+
8
+ export interface deleteQuery extends IObject {
9
+ /**
10
+ * 删除的id,多个按','分割
11
+ */
12
+ ids: string;
13
+ }
14
+ export interface postCopyVersionIdPathParams {
15
+ id: string;
16
+ }
17
+ export interface getGetVersionByIdQuery extends IObject {
18
+ /**
19
+ * id
20
+ */
21
+ id: string;
22
+ }
23
+ export interface getInfoQuery extends IObject {
24
+ /**
25
+ * id
26
+ */
27
+ id: string;
28
+ }
29
+ export interface getListVersionByIdQuery extends IObject {
30
+ /**
31
+ * baseId
32
+ */
33
+ baseId: string;
34
+ /**
35
+ * 根据名称搜索
36
+ */
37
+ name?: string;
38
+ }
39
+ export interface getPageListQuery extends IObject {
40
+ /**
41
+ * 查询条件
42
+ */
43
+ keyword?: string;
44
+ /**
45
+ * 页码
46
+ */
47
+ pageNo?: number;
48
+ /**
49
+ * 每页数据条数
50
+ */
51
+ pageSize?: number;
52
+ }
53
+ export interface deleteRemoveVersionByIdQuery extends IObject {
54
+ /**
55
+ * 删除的id
56
+ */
57
+ id: string;
58
+ }
59
+ export interface putUpdateVersionByIdIdPathParams {
60
+ id: string;
61
+ }
62
+ export interface putIdPathParams {
63
+ id: string;
64
+ }
65
+ export interface TransactionService {
66
+ /**
67
+ * 保存
68
+ */
69
+ post(
70
+ data: TransactionRequest,
71
+ config?: Partial<AxiosRequestConfig>,
72
+ ): Promise<string>;
73
+ /**
74
+ * 删除父
75
+ */
76
+ delete(
77
+ query: deleteQuery,
78
+ config?: Partial<AxiosRequestConfig>,
79
+ ): Promise<string>;
80
+ /**
81
+ * 复制
82
+ */
83
+ postCopy(
84
+ data: TransactionRequest,
85
+ config?: Partial<AxiosRequestConfig>,
86
+ ): Promise<string>;
87
+ /**
88
+ * 复制版本
89
+ */
90
+ postCopyVersionId(
91
+ path: postCopyVersionIdPathParams,
92
+ data: TransactionRequest,
93
+ config?: Partial<AxiosRequestConfig>,
94
+ ): Promise<string>;
95
+ /**
96
+ * 根据id查子
97
+ */
98
+ getGetVersionById(
99
+ query: getGetVersionByIdQuery,
100
+ config?: Partial<AxiosRequestConfig>,
101
+ ): Promise<TransactionResponse>;
102
+ /**
103
+ * 详情
104
+ */
105
+ getInfo(
106
+ query: getInfoQuery,
107
+ config?: Partial<AxiosRequestConfig>,
108
+ ): Promise<TransactionResponse>;
109
+ /**
110
+ * 列表
111
+ */
112
+ getList(config?: Partial<AxiosRequestConfig>): Promise<TransactionResponse[]>;
113
+ /**
114
+ * 根据父baseId 查所有版本
115
+ */
116
+ getListVersionById(
117
+ query: getListVersionByIdQuery,
118
+ config?: Partial<AxiosRequestConfig>,
119
+ ): Promise<TransactionResponse[]>;
120
+ /**
121
+ * 分页列表
122
+ */
123
+ getPageList(
124
+ query: getPageListQuery,
125
+ config?: Partial<AxiosRequestConfig>,
126
+ ): Promise<IPage<TransactionDTO>>;
127
+ /**
128
+ * 删除版本
129
+ */
130
+ deleteRemoveVersionById(
131
+ query: deleteRemoveVersionByIdQuery,
132
+ config?: Partial<AxiosRequestConfig>,
133
+ ): Promise<string>;
134
+ /**
135
+ * 保存版本
136
+ */
137
+ postSaveVersion(
138
+ data: TransactionRequest,
139
+ config?: Partial<AxiosRequestConfig>,
140
+ ): Promise<string>;
141
+ /**
142
+ * 修改版本
143
+ */
144
+ putUpdateVersionByIdId(
145
+ path: putUpdateVersionByIdIdPathParams,
146
+ data: TransactionRequest,
147
+ config?: Partial<AxiosRequestConfig>,
148
+ ): Promise<string>;
149
+ /**
150
+ * 修改
151
+ */
152
+ putId(
153
+ path: putIdPathParams,
154
+ data: TransactionRequest,
155
+ config?: Partial<AxiosRequestConfig>,
156
+ ): Promise<string>;
157
+ }
@@ -0,0 +1,31 @@
1
+ import type { AxiosRequestConfig } from 'axios';
2
+ import type { UserInfo } from '../entities';
3
+
4
+ export interface getInfoQuery extends IObject {
5
+ /**
6
+ * userId
7
+ */
8
+ userId: string;
9
+ }
10
+ export interface getInfosQuery extends IObject {
11
+ /**
12
+ * 用户id,以英文逗号分割:id,id,id
13
+ */
14
+ userIds: string;
15
+ }
16
+ export interface UserService {
17
+ /**
18
+ * 获取用户信息
19
+ */
20
+ getInfo(
21
+ query: getInfoQuery,
22
+ config?: Partial<AxiosRequestConfig>,
23
+ ): Promise<UserInfo>;
24
+ /**
25
+ * 获取用户信息列表
26
+ */
27
+ getInfos(
28
+ query: getInfosQuery,
29
+ config?: Partial<AxiosRequestConfig>,
30
+ ): Promise<UserInfo[]>;
31
+ }
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-empty-object-type */
2
1
  export interface AccountConfig {
3
2
  /**
4
3
  * 应用类型 枚举 (钉钉 DINGDING,企微 QIYEWEIXIN,飞书 FEISHU,微软 MICROSOFT)
@@ -5824,6 +5823,12 @@ export interface DocOutlineResponse {
5824
5823
  * @type string
5825
5824
  */
5826
5825
  instanceStatus?: string;
5826
+ /**
5827
+ * 模型Key
5828
+ *
5829
+ * @type string
5830
+ */
5831
+ modelKey?: string;
5827
5832
  /**
5828
5833
  *
5829
5834
  *
@@ -5854,6 +5859,12 @@ export interface DocOutlineResponse {
5854
5859
  * @type number
5855
5860
  */
5856
5861
  ofRequired?: number;
5862
+ /**
5863
+ * 办公类型
5864
+ *
5865
+ * @type string
5866
+ */
5867
+ officeType?: string;
5857
5868
  /**
5858
5869
  * 父节点id
5859
5870
  *
@@ -13962,18 +13973,6 @@ export interface MessageRecordResponse {
13962
13973
  * @type string
13963
13974
  */
13964
13975
  resultMsg?: string;
13965
- /**
13966
- * 跳转配置: {"WEB":"菜单id","MOBILE":"菜单id","PAD":"菜单id"}
13967
- *
13968
- * @type string
13969
- */
13970
- routerConfig?: string;
13971
- /**
13972
- * 跳转参数:由调用全局方法方传递
13973
- *
13974
- * @type string
13975
- */
13976
- routerParams?: string;
13977
13976
  /**
13978
13977
  * 租户id
13979
13978
  *
@@ -14098,12 +14097,6 @@ export interface MessageTmplRequest {
14098
14097
  * @type string
14099
14098
  */
14100
14099
  rangUser?: string;
14101
- /**
14102
- * 跳转配置: {"WEB":"菜单id","MOBILE":"菜单id","PAD":"菜单id"}
14103
- *
14104
- * @type string
14105
- */
14106
- routerConfig?: string;
14107
14100
  /**
14108
14101
  * 租户id
14109
14102
  *
@@ -14220,12 +14213,6 @@ export interface MessageTmplResponse {
14220
14213
  * @type string
14221
14214
  */
14222
14215
  pushType?: string;
14223
- /**
14224
- * 跳转配置: {"WEB":"菜单id","MOBILE":"菜单id","PAD":"菜单id"}
14225
- *
14226
- * @type string
14227
- */
14228
- routerConfig?: string;
14229
14216
  /**
14230
14217
  * 租户id
14231
14218
  *
@@ -14384,18 +14371,6 @@ export interface MessageTmplSendRequest {
14384
14371
  * @type string
14385
14372
  */
14386
14373
  rangUser?: string;
14387
- /**
14388
- *
14389
- *
14390
- * @type string
14391
- */
14392
- routerConfig?: string;
14393
- /**
14394
- *
14395
- *
14396
- * @type string
14397
- */
14398
- routerParams?: string;
14399
14374
  /**
14400
14375
  * 支持流程
14401
14376
  *
@@ -18060,6 +18035,12 @@ export interface OnlineFormInstanceDTO {
18060
18035
  * @type string
18061
18036
  */
18062
18037
  ofCode?: string;
18038
+ /**
18039
+ *
18040
+ *
18041
+ * @type string
18042
+ */
18043
+ officeType?: string;
18063
18044
  /**
18064
18045
  *
18065
18046
  *
@@ -18304,6 +18285,12 @@ export interface OnlineFormInstanceRequest {
18304
18285
  * @type string
18305
18286
  */
18306
18287
  modelKey?: string;
18288
+ /**
18289
+ *
18290
+ *
18291
+ * @type string
18292
+ */
18293
+ officeType?: string;
18307
18294
  /**
18308
18295
  * 实例参数(业务扩展属性)
18309
18296
  *
@@ -1969,7 +1969,9 @@ export const apiConfig = [
1969
1969
  mode: "post",
1970
1970
  method: "postActivatesOffline",
1971
1971
  path: "activatesOffline",
1972
- hasQuery: true
1972
+ hasUpload: true,
1973
+ hasQuery: true,
1974
+ hasData: true
1973
1975
  },
1974
1976
  {
1975
1977
  mode: "get",
@@ -2015,7 +2017,8 @@ export const apiConfig = [
2015
2017
  {
2016
2018
  mode: "get",
2017
2019
  method: "getModuleAuth",
2018
- path: "moduleAuth"
2020
+ path: "moduleAuth",
2021
+ hasQuery: true
2019
2022
  },
2020
2023
  {
2021
2024
  mode: "get",
@@ -2900,7 +2903,9 @@ export const apiConfig = [
2900
2903
  mode: "post",
2901
2904
  method: "postUploadZip",
2902
2905
  path: "uploadZip",
2903
- hasQuery: true
2906
+ hasUpload: true,
2907
+ hasQuery: true,
2908
+ hasData: true
2904
2909
  },
2905
2910
  {
2906
2911
  mode: "put",
@@ -5600,7 +5605,8 @@ export const apiConfig = [
5600
5605
  {
5601
5606
  mode: "get",
5602
5607
  method: "getLicenseModuleAuth",
5603
- path: "license/moduleAuth"
5608
+ path: "license/moduleAuth",
5609
+ hasQuery: true
5604
5610
  },
5605
5611
  {
5606
5612
  mode: "post",
@@ -512,6 +512,12 @@ export interface getLicenseGetAppEffectiveLicenseQuery extends IObject {
512
512
  */
513
513
  env: string;
514
514
  }
515
+ export interface getLicenseModuleAuthQuery extends IObject {
516
+ /**
517
+ * 授权模块
518
+ */
519
+ module?: string;
520
+ }
515
521
  export interface getLoginSettingGetQuery extends IObject {
516
522
  /**
517
523
  * code
@@ -1261,7 +1267,10 @@ export interface ApiService {
1261
1267
  /**
1262
1268
  * 判断对应模块是否已进行授权
1263
1269
  */
1264
- getLicenseModuleAuth(config?: Partial<AxiosRequestConfig>): Promise<boolean>;
1270
+ getLicenseModuleAuth(
1271
+ query: getLicenseModuleAuthQuery,
1272
+ config?: Partial<AxiosRequestConfig>,
1273
+ ): Promise<boolean>;
1265
1274
  /**
1266
1275
  * 用户登录日志分页查询
1267
1276
  */
@@ -203,6 +203,10 @@ export interface getModelMetaListQuery extends IObject {
203
203
  *
204
204
  */
205
205
  modifyUserName?: string;
206
+ /**
207
+ * 所属模块(实体、枚举、web页面 、view_model_module/视图模型模块 、data_model/数据模型模块、document_module/单据)
208
+ */
209
+ module?: string;
206
210
  /**
207
211
  *
208
212
  */
@@ -32,10 +32,6 @@ export interface getPageListQuery extends IObject {
32
32
  * 每页数据条数
33
33
  */
34
34
  pageSize?: number;
35
- /**
36
- * 仪表盘来源
37
- */
38
- source?: number;
39
35
  }
40
36
  export interface putIdPathParams {
41
37
  id: string;
@@ -98,6 +98,12 @@ export interface getInfoQuery extends IObject {
98
98
  */
99
99
  licenseId: string;
100
100
  }
101
+ export interface getModuleAuthQuery extends IObject {
102
+ /**
103
+ * 授权模块
104
+ */
105
+ module?: string;
106
+ }
101
107
  export interface getPageListQuery extends IObject {
102
108
  /**
103
109
  * 应用id
@@ -166,8 +172,9 @@ export interface LicenseService {
166
172
  */
167
173
  postActivatesOffline(
168
174
  query: postActivatesOfflineQuery,
175
+ data: UploadFileData,
169
176
  config?: Partial<AxiosRequestConfig>,
170
- ): Promise<string>;
177
+ ): Promise<IHttpResponse<string>>;
171
178
  /**
172
179
  * 证书校验,用于平台登录前判断是否在有效期
173
180
  */
@@ -217,7 +224,10 @@ export interface LicenseService {
217
224
  /**
218
225
  * 判断对应模块是否已进行授权
219
226
  */
220
- getModuleAuth(config?: Partial<AxiosRequestConfig>): Promise<boolean>;
227
+ getModuleAuth(
228
+ query: getModuleAuthQuery,
229
+ config?: Partial<AxiosRequestConfig>,
230
+ ): Promise<boolean>;
221
231
  /**
222
232
  * 平台/应用,授权列表
223
233
  */
@@ -81,10 +81,6 @@ export interface getUserPageListQuery extends IObject {
81
81
  * 排序方式:ASC/DESC, 不传默认 ASC
82
82
  */
83
83
  sortType?: string;
84
- /**
85
- * 参数来源,0企业后台管理、1租户后台管理
86
- */
87
- source?: number;
88
84
  /**
89
85
  * 创建开始时间
90
86
  */
@@ -172,8 +172,9 @@ export interface PluginService {
172
172
  */
173
173
  postUploadZip(
174
174
  query: postUploadZipQuery,
175
+ data: UploadFileData,
175
176
  config?: Partial<AxiosRequestConfig>,
176
- ): Promise<PackageJson>;
177
+ ): Promise<IHttpResponse<PackageJson>>;
177
178
  /**
178
179
  * 修改
179
180
  */
@@ -131,10 +131,6 @@ export interface getManagementOrgUserPageListQuery extends IObject {
131
131
  * 排序方式:ASC/DESC, 不传默认 ASC
132
132
  */
133
133
  sortType?: string;
134
- /**
135
- * 参数来源,0企业后台管理、1租户后台管理
136
- */
137
- source?: number;
138
134
  /**
139
135
  * 创建开始时间
140
136
  */
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-empty-object-type */
2
1
  export interface APIDatasetConfigDTO {
3
2
  /**
4
3
  * 开始时间
@@ -1,12 +1,10 @@
1
1
  import { apiConfig as aPaasConfig } from "../apaas/index.mjs";
2
2
  import { apiConfig as platformConfig } from "../platform/index.mjs";
3
3
  import { ApiManage } from "./api-manage.mjs";
4
- import { installHttpUtil } from "./request.client.mjs";
5
4
  export const api = {
6
5
  apaas: new ApiManage("/gct-apaas/api", aPaasConfig),
7
6
  platform: new ApiManage("/gct-platform/api", platformConfig)
8
7
  };
9
- installHttpUtil();
10
8
  export {
11
9
  ResultEnum,
12
10
  RequestEnum,
@@ -28,6 +28,14 @@ declare global {
28
28
  * @interface IObject
29
29
  */
30
30
  type IObject = Record<string | symbol, any>;
31
+ interface Window {
32
+ /**
33
+ * 安卓混合开发模式标识,由原生层注入,值为 true 时表示在安卓混合开发模式下运行
34
+ *
35
+ * @type {boolean}
36
+ */
37
+ __GCT_ANDROID__?: boolean;
38
+ }
31
39
 
32
40
  /**
33
41
  * 查询分页对象
@@ -1,4 +1,3 @@
1
- export { NativeHTTP } from './native-http/native-http';
2
1
  /**
3
2
  * 拼接 URL 路径片段,处理多余的斜杠
4
3
  *
@@ -1,4 +1,3 @@
1
- export { NativeHTTP } from "./native-http/native-http.mjs";
2
1
  import { cloneDeep, isEqual, mergeWith, unionWith } from "lodash-es";
3
2
  export function joinPath(...segments) {
4
3
  return segments.map((seg, i) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/api",
3
- "version": "0.1.6-dev.1",
3
+ "version": "0.1.6-dev.11",
4
4
  "description": "paas 平台底包",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -65,12 +65,12 @@
65
65
  "publish:test": "npm publish --access public --tag=test --registry=https://registry.npmjs.org/",
66
66
  "publish:beta": "npm publish --access public --tag=beta --registry=https://registry.npmjs.org/",
67
67
  "publish:npm": "npm publish --access public --registry=https://registry.npmjs.org/",
68
+ "gen-api:alpha": "./script/gen-api.sh http://paas.alpha.gct-paas.com",
68
69
  "gen-api:dev": "./script/gen-api.sh http://paas.paasdev.gct-paas.com",
69
70
  "gen-api:test": "./script/gen-api.sh"
70
71
  },
71
72
  "dependencies": {
72
73
  "axios": "^1.16.0",
73
- "dsbridge": "^3.1.4",
74
74
  "lodash-es": "^4.18.1",
75
75
  "qs": "^6.15.1"
76
76
  },
@@ -80,8 +80,8 @@
80
80
  "devDependencies": {
81
81
  "@babel/preset-env": "^7.29.5",
82
82
  "@commitlint/cli": "^20.5.3",
83
- "@gct-paas/build": "^0.1.12",
84
- "@gct-paas/cli": "^0.1.19",
83
+ "@gct-paas/build": "^0.1.14",
84
+ "@gct-paas/cli": "^0.1.21",
85
85
  "@types/fs-extra": "^11.0.4",
86
86
  "@types/lodash-es": "^4.17.12",
87
87
  "@types/node": "^25.6.2",
@@ -1,6 +0,0 @@
1
- /**
2
- * 安装 HTTP 工具类,配置 android 原生适配器和拦截器
3
- *
4
- * @export
5
- */
6
- export declare function installHttpUtil(): void;
@@ -1,35 +0,0 @@
1
- import { NativeHTTP } from "../utils/index.mjs";
2
- import { HttpUtil } from "./http.util.mjs";
3
- export function installHttpUtil() {
4
- if (window.location.host !== "appassets.androidplatform.net") {
5
- console.debug("\u5F53\u524D\u73AF\u5883\u975E Android\uFF0C\u5DF2\u8DF3\u8FC7 HTTP \u5DE5\u5177\u7C7B\u5B89\u88C5");
6
- return;
7
- }
8
- const nativeAdapter = async (config) => {
9
- const response = await NativeHTTP.request(config);
10
- return response;
11
- };
12
- HttpUtil._instance.defaults.adapter = nativeAdapter;
13
- const errorHandler = (error) => {
14
- if (error?.response?.status === 401) {
15
- console.log("\u767B\u5F55\u4FE1\u606F\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55");
16
- } else {
17
- console.log("\u7F51\u7EDC\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");
18
- }
19
- return Promise.reject(error);
20
- };
21
- HttpUtil._instance.interceptors.request.use((config) => {
22
- config.headers["App-Tag"] = "__platform__";
23
- return config;
24
- }, errorHandler);
25
- HttpUtil._instance.interceptors.response.use((response) => {
26
- if (response.data.code === 200) {
27
- return response.data.data;
28
- }
29
- const errorMessageMode = response.config?.errorMessageMode;
30
- if (errorMessageMode !== "none") {
31
- console.log(response.data.message);
32
- }
33
- return Promise.reject(response.data);
34
- }, errorHandler);
35
- }
@@ -1,6 +0,0 @@
1
- import type { InternalAxiosRequestConfig } from 'axios';
2
- export declare const NativeHTTP: {
3
- request(querydata: InternalAxiosRequestConfig): Promise<unknown>;
4
- urlDecode(arg: string): Promise<string>;
5
- urlDecodeSync(arg: string): string;
6
- };
@@ -1,63 +0,0 @@
1
- import dsBridge from "dsbridge";
2
- import qs from "qs";
3
- export const NativeHTTP = {
4
- request(querydata) {
5
- const { method, url, timeout, params, headers, data, baseURL } = querydata;
6
- const pathparam = "?" + qs.stringify(params);
7
- const allurl = (baseURL + url).replace(/([^:])\/\//g, "$1/") + pathparam;
8
- console.info(allurl + ">>HTTP", querydata);
9
- const startTime = performance.now();
10
- return new Promise((resolve, reject) => {
11
- dsBridge.call(
12
- "HTTP." + method,
13
- {
14
- url: allurl,
15
- timeout,
16
- headers,
17
- data: data && typeof data === "string" ? JSON.parse(data) : data
18
- },
19
- function(res) {
20
- const nativeData = JSON.parse(res);
21
- console.info(
22
- allurl + `>>HTTP.response-\u8017\u65F6\uFF1A${performance.now() - startTime}`,
23
- nativeData
24
- );
25
- if (nativeData.code === 0 && nativeData.http_code === 200) {
26
- resolve({ ...nativeData, config: querydata });
27
- } else {
28
- const response = {
29
- message: nativeData.message,
30
- status: nativeData.http_code
31
- };
32
- reject({ response, config: querydata });
33
- }
34
- }
35
- );
36
- });
37
- },
38
- urlDecode(arg) {
39
- return new Promise((resolve, reject) => {
40
- return dsBridge.call("HTTP.urlDecode", arg, function(res) {
41
- if (res) {
42
- const data = JSON.parse(res);
43
- if (data.code === 0) {
44
- resolve(data.data);
45
- return;
46
- }
47
- }
48
- reject();
49
- });
50
- });
51
- },
52
- urlDecodeSync(arg) {
53
- if (!arg) return "";
54
- const res = dsBridge.call("HTTP.urlDecodeSync", arg);
55
- if (res) {
56
- const data = JSON.parse(res);
57
- if (data.code === 0) {
58
- return data.data;
59
- }
60
- }
61
- return "";
62
- }
63
- };