@jctrans-materials/shared 1.0.24 → 1.0.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/index.cjs.js +5 -5
- package/dist/index.d.ts +1018 -0
- package/dist/index.esm.js +406 -409
- package/package.json +1 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1018 @@
|
|
|
1
|
+
import { Emitter } from 'mitt';
|
|
2
|
+
|
|
3
|
+
declare type ActionKeys = (typeof MODAL_ACTION)[keyof typeof MODAL_ACTION];
|
|
4
|
+
|
|
5
|
+
declare interface ApiResponse<T = any> {
|
|
6
|
+
code: number;
|
|
7
|
+
msg: string;
|
|
8
|
+
data: T;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export declare interface AppointSearch {
|
|
12
|
+
name: AppointSearchName;
|
|
13
|
+
val: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare type AppointSearchName = "continentId" | "countryId" | "cityId" | "provinceId" | "seaportId" | "airportId" | "allCityByCountryId";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 1-1-2.TGC自动登录
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare function autoLoginByTGC(data: {
|
|
23
|
+
toSys: string;
|
|
24
|
+
path: string;
|
|
25
|
+
tgc: string;
|
|
26
|
+
tokenId?: string;
|
|
27
|
+
}): Promise<any>;
|
|
28
|
+
|
|
29
|
+
export declare interface BaseResponse<T = any> {
|
|
30
|
+
records: T[];
|
|
31
|
+
total: number;
|
|
32
|
+
size: number;
|
|
33
|
+
current: number;
|
|
34
|
+
pages?: number;
|
|
35
|
+
[k: string]: any;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 验证验证码绑定第三方应用
|
|
40
|
+
* @param data
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
export declare function bindThirdPartyByCodeApi(data: any): Promise<any>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 验证密码绑定第三方应用
|
|
47
|
+
* @param data
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
export declare function bindThirdPartyByPwdApi(data: any): Promise<any>;
|
|
51
|
+
|
|
52
|
+
declare interface CarrierRequestPayload {
|
|
53
|
+
current: number;
|
|
54
|
+
size: number;
|
|
55
|
+
lineType: "air" | "shipping";
|
|
56
|
+
searchkey?: string;
|
|
57
|
+
ids?: number[];
|
|
58
|
+
[key: string]: any;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export declare function checkAccountExistsFPApi(data: any): Promise<any>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 验证邮件验证码
|
|
65
|
+
* @param data
|
|
66
|
+
* @returns
|
|
67
|
+
*/
|
|
68
|
+
export declare function checkEmailCodeApi(data: {
|
|
69
|
+
uuid: string;
|
|
70
|
+
code: string;
|
|
71
|
+
target: string;
|
|
72
|
+
}): Promise<any>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* 验证手机验证码
|
|
76
|
+
* @param data
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
export declare function checkMobileCodeApi(data: {
|
|
80
|
+
code: string;
|
|
81
|
+
uuid: string;
|
|
82
|
+
target: string;
|
|
83
|
+
}): Promise<any>;
|
|
84
|
+
|
|
85
|
+
export declare function clearAllAuth(): void;
|
|
86
|
+
|
|
87
|
+
export declare interface CommonParams {
|
|
88
|
+
current?: number;
|
|
89
|
+
size?: number;
|
|
90
|
+
level?: 1 | 2 | 3 | 4;
|
|
91
|
+
searchContent?: string;
|
|
92
|
+
displayInfo?: DisplayInfo[];
|
|
93
|
+
sort?: "nameEn" | string;
|
|
94
|
+
appointSearch?: AppointSearch[];
|
|
95
|
+
_extra?: Record<string, any>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export declare interface CompanyOption {
|
|
99
|
+
current: number;
|
|
100
|
+
size: number;
|
|
101
|
+
compName: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 完善公司信息跳转
|
|
106
|
+
* @param {*} data
|
|
107
|
+
* @returns
|
|
108
|
+
*/
|
|
109
|
+
export declare function completeCompRedirectApi(data: any): Promise<any>;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* 完善信息加入公司
|
|
113
|
+
* @param data
|
|
114
|
+
* @returns
|
|
115
|
+
*/
|
|
116
|
+
export declare function completeJoinCompanyRedirectApi(data: any): Promise<any>;
|
|
117
|
+
|
|
118
|
+
export declare function createRequest(driver: RequestDriver, options?: RequestOptions): RequestAdapter;
|
|
119
|
+
|
|
120
|
+
export declare const currentConfig: {
|
|
121
|
+
readonly basePath: string;
|
|
122
|
+
readonly carrierPath: string;
|
|
123
|
+
readonly linePath: string;
|
|
124
|
+
readonly oldBasePath: string;
|
|
125
|
+
readonly prefixPath: string;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* 解密方法
|
|
130
|
+
* @param word
|
|
131
|
+
* @returns
|
|
132
|
+
*/
|
|
133
|
+
export declare function Decrypt(word: string): string;
|
|
134
|
+
|
|
135
|
+
export declare type DisplayInfo = "Continent" | "Country" | "Province" | "City" | "Seaport" | "Airport";
|
|
136
|
+
|
|
137
|
+
export declare const emitter: Emitter<ModalEvents>;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* 加密方法
|
|
141
|
+
* @param word
|
|
142
|
+
* @returns
|
|
143
|
+
*/
|
|
144
|
+
export declare function Encrypt(word: string): string;
|
|
145
|
+
|
|
146
|
+
export declare const ExpiresInKey = "JC-Expires-In";
|
|
147
|
+
|
|
148
|
+
export declare const ExpiresInTimeKey = "JC-Expires-Time-In";
|
|
149
|
+
|
|
150
|
+
export declare function findDictAPi(data?: {
|
|
151
|
+
size: number;
|
|
152
|
+
}): Promise<any>;
|
|
153
|
+
|
|
154
|
+
export declare function findListByMobileEmailApi(data: any): Promise<any>;
|
|
155
|
+
|
|
156
|
+
export declare function findPAreaCodeAPi(data?: {
|
|
157
|
+
size: number;
|
|
158
|
+
}): Promise<any>;
|
|
159
|
+
|
|
160
|
+
export declare function getAirport(params?: {
|
|
161
|
+
page?: number;
|
|
162
|
+
size?: number;
|
|
163
|
+
ids?: number[];
|
|
164
|
+
cityId?: number;
|
|
165
|
+
countryId?: number;
|
|
166
|
+
}): Promise<BaseResponse<UnifiedItem>>;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* 跨环境获取 AppId (兼容 Vite, Webpack, Nuxt)
|
|
170
|
+
*/
|
|
171
|
+
export declare function getAppId(): string;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* 全局获取 session
|
|
175
|
+
* @returns
|
|
176
|
+
*/
|
|
177
|
+
export declare function getAuthSessionItems(): {
|
|
178
|
+
activityCode: string | null;
|
|
179
|
+
referenceUserId: string | null;
|
|
180
|
+
empNo: string | null;
|
|
181
|
+
uniqueCode: string | null;
|
|
182
|
+
path: string | null;
|
|
183
|
+
clickSource: string | null;
|
|
184
|
+
registerEvent?: string | null;
|
|
185
|
+
registerType?: string | null;
|
|
186
|
+
compKey?: string | null;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
/** 单 id 版本 */
|
|
190
|
+
export declare function getById(type: DisplayInfo, id: number): Promise<UnifiedItem | null>;
|
|
191
|
+
|
|
192
|
+
/** 按 type + ids 精确查询(回显/编辑页) */
|
|
193
|
+
export declare function getByIds(type: DisplayInfo, ids: number[] | number): Promise<UnifiedItem[]>;
|
|
194
|
+
|
|
195
|
+
/** 城市 -> 子实体(港口、机场 或 二者) */
|
|
196
|
+
export declare function getChildrenByCity(cityId: number, childTypes: Array<"Seaport" | "Airport">, opts?: {
|
|
197
|
+
page?: number;
|
|
198
|
+
size?: number;
|
|
199
|
+
}): Promise<BaseResponse<UnifiedItem>>;
|
|
200
|
+
|
|
201
|
+
/** 国家 -> 城市(后端专门支持 allCityByCountryId 口径) */
|
|
202
|
+
export declare function getCitiesByCountry(countryId: number, opts?: {
|
|
203
|
+
page?: number;
|
|
204
|
+
size?: number;
|
|
205
|
+
}): Promise<BaseResponse<UnifiedItem>>;
|
|
206
|
+
|
|
207
|
+
export declare function getCity(params?: {
|
|
208
|
+
page?: number;
|
|
209
|
+
size?: number;
|
|
210
|
+
ids?: number[];
|
|
211
|
+
countryId?: number;
|
|
212
|
+
}): Promise<BaseResponse<UnifiedItem>>;
|
|
213
|
+
|
|
214
|
+
export declare const getCompanyOptionApi: (data: CompanyOption) => Promise<any>;
|
|
215
|
+
|
|
216
|
+
/** 保留对外兼容函数:getContinent/getCountry/getCity/getProvince/getSeaport/getAirport */
|
|
217
|
+
export declare function getContinent(params?: {
|
|
218
|
+
page?: number;
|
|
219
|
+
size?: number;
|
|
220
|
+
}): Promise<BaseResponse<UnifiedItem>>;
|
|
221
|
+
|
|
222
|
+
export declare function getCountry(params?: {
|
|
223
|
+
page?: number;
|
|
224
|
+
size?: number;
|
|
225
|
+
ids?: number[];
|
|
226
|
+
}): Promise<BaseResponse<UnifiedItem>>;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* 🚀 补全:获取 Access Token 的过期时间戳 (用于判断是否需要刷新)
|
|
230
|
+
*/
|
|
231
|
+
export declare function getExpiresTimeIn(): number;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* 获取一级域名 (用于 Cookie 跨域共享)
|
|
235
|
+
*/
|
|
236
|
+
export declare function getFirstDomain(): string | undefined;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* 兼容全环境的语言判断方法
|
|
240
|
+
* 逻辑优先级:Nuxt Composables > 浏览器 Cookie > Nuxt SSR 上下文
|
|
241
|
+
*/
|
|
242
|
+
export declare const getIsEn: () => boolean;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* 获取用户加入公司信息
|
|
246
|
+
* @param data
|
|
247
|
+
* @returns
|
|
248
|
+
*/
|
|
249
|
+
export declare function getJoinCompanyApi(data: any): Promise<any>;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* 获取登录微信二维码
|
|
253
|
+
* @param data
|
|
254
|
+
* @returns
|
|
255
|
+
*/
|
|
256
|
+
export declare function getLoginQrCode(data?: {}): Promise<any>;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* 忘记密码发送验证码
|
|
260
|
+
* @param data
|
|
261
|
+
* @returns
|
|
262
|
+
*/
|
|
263
|
+
export declare function getMEVCodeApi(data: any): Promise<any>;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* 跨环境获取 Path
|
|
267
|
+
*/
|
|
268
|
+
export declare function getPathFromConfig(config: any): string;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* 4. 导出操作方法
|
|
272
|
+
*/
|
|
273
|
+
export declare function getProjectId(): string | undefined;
|
|
274
|
+
|
|
275
|
+
export declare function getProvince(params?: {
|
|
276
|
+
page?: number;
|
|
277
|
+
size?: number;
|
|
278
|
+
ids?: number[];
|
|
279
|
+
countryId?: number;
|
|
280
|
+
}): Promise<BaseResponse<UnifiedItem>>;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* 跳转其他站
|
|
284
|
+
* @param appId
|
|
285
|
+
* @param path
|
|
286
|
+
* @returns
|
|
287
|
+
*/
|
|
288
|
+
export declare function getRedirectPathApi(appId: string, path: string): Promise<any>;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* 🚀 补全:获取当前的 Refresh Token
|
|
292
|
+
*/
|
|
293
|
+
export declare function getRefreshToken(): string | undefined;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* 获取记住的账号
|
|
297
|
+
*/
|
|
298
|
+
export declare function getRememberAccount(): {
|
|
299
|
+
account?: string;
|
|
300
|
+
password?: string;
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
export declare function getSeaport(params?: {
|
|
304
|
+
page?: number;
|
|
305
|
+
size?: number;
|
|
306
|
+
ids?: number[];
|
|
307
|
+
cityId?: number;
|
|
308
|
+
countryId?: number;
|
|
309
|
+
}): Promise<BaseResponse<UnifiedItem>>;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* 获取当前配置
|
|
313
|
+
*/
|
|
314
|
+
export declare const getSharedConfig: () => {
|
|
315
|
+
readonly basePath: string;
|
|
316
|
+
readonly carrierPath: string;
|
|
317
|
+
readonly linePath: string;
|
|
318
|
+
readonly oldBasePath: string;
|
|
319
|
+
readonly prefixPath: string;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* 获取当前的 Access Token
|
|
324
|
+
*/
|
|
325
|
+
export declare function getToken(): string | undefined;
|
|
326
|
+
|
|
327
|
+
export declare const HasLoginKey = "hasLogin";
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* 全局初始化方法,在项目入口调用
|
|
331
|
+
*/
|
|
332
|
+
export declare const initSharedConfig: (newConfig: Partial<SharedConfig>) => void;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* 获取邀请加入公司信息
|
|
336
|
+
* @param data
|
|
337
|
+
* @returns
|
|
338
|
+
*/
|
|
339
|
+
export declare function inviteJoinGetCompApi(data: any): Promise<any>;
|
|
340
|
+
|
|
341
|
+
declare interface IResponse<T> {
|
|
342
|
+
data: T;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* 判断域名是否为 IP
|
|
347
|
+
*/
|
|
348
|
+
export declare function isIpAddress(hostname: string): boolean;
|
|
349
|
+
|
|
350
|
+
declare interface LineRequestPayload {
|
|
351
|
+
current: number;
|
|
352
|
+
size: number;
|
|
353
|
+
lineType: "air" | "shipping";
|
|
354
|
+
searchkey?: string;
|
|
355
|
+
ids?: number[];
|
|
356
|
+
[key: string]: any;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export declare const locationSearchV2: {
|
|
360
|
+
SEARCH_VERSION: string;
|
|
361
|
+
searchByName: (params: SearchGenericParams) => Promise<{
|
|
362
|
+
records: LocationUnifiedItem[];
|
|
363
|
+
total: number;
|
|
364
|
+
current: number;
|
|
365
|
+
size: number;
|
|
366
|
+
}>;
|
|
367
|
+
searchByIdWithType: (id: number | string | Array<number | string>, type: LocationType, extraParams?: {
|
|
368
|
+
lineType?: "air" | "shipping";
|
|
369
|
+
}) => Promise<{
|
|
370
|
+
records: LocationUnifiedItem[];
|
|
371
|
+
total: number;
|
|
372
|
+
current: number;
|
|
373
|
+
size: number;
|
|
374
|
+
}>;
|
|
375
|
+
country: {
|
|
376
|
+
searchByName: (params: SearchByNameParams) => Promise<{
|
|
377
|
+
records: LocationUnifiedItem[];
|
|
378
|
+
total: number;
|
|
379
|
+
current: number;
|
|
380
|
+
size: number;
|
|
381
|
+
}>;
|
|
382
|
+
getByIds: (ids: number[]) => Promise<{
|
|
383
|
+
records: LocationUnifiedItem[];
|
|
384
|
+
total: number;
|
|
385
|
+
current: number;
|
|
386
|
+
size: number;
|
|
387
|
+
}>;
|
|
388
|
+
};
|
|
389
|
+
region: {
|
|
390
|
+
searchByName: (params: SearchByNameParams) => Promise<{
|
|
391
|
+
records: LocationUnifiedItem[];
|
|
392
|
+
total: number;
|
|
393
|
+
current: number;
|
|
394
|
+
size: number;
|
|
395
|
+
}>;
|
|
396
|
+
getByIds: (ids: number[]) => Promise<{
|
|
397
|
+
records: LocationUnifiedItem[];
|
|
398
|
+
total: number;
|
|
399
|
+
current: number;
|
|
400
|
+
size: number;
|
|
401
|
+
}>;
|
|
402
|
+
};
|
|
403
|
+
city: {
|
|
404
|
+
searchByName: (params: SearchWithScopeParams) => Promise<{
|
|
405
|
+
records: LocationUnifiedItem[];
|
|
406
|
+
total: number;
|
|
407
|
+
current: number;
|
|
408
|
+
size: number;
|
|
409
|
+
}>;
|
|
410
|
+
getByIds: (ids: number[]) => Promise<{
|
|
411
|
+
records: LocationUnifiedItem[];
|
|
412
|
+
total: number;
|
|
413
|
+
current: number;
|
|
414
|
+
size: number;
|
|
415
|
+
}>;
|
|
416
|
+
getCitiesByCountry: (countryId: number, params?: PageParams) => Promise<{
|
|
417
|
+
records: LocationUnifiedItem[];
|
|
418
|
+
total: number;
|
|
419
|
+
current: number;
|
|
420
|
+
size: number;
|
|
421
|
+
}>;
|
|
422
|
+
};
|
|
423
|
+
seaport: {
|
|
424
|
+
searchByName: (params: SearchWithScopeParams) => Promise<{
|
|
425
|
+
records: LocationUnifiedItem[];
|
|
426
|
+
total: number;
|
|
427
|
+
current: number;
|
|
428
|
+
size: number;
|
|
429
|
+
}>;
|
|
430
|
+
getByIds: (ids: number[]) => Promise<{
|
|
431
|
+
records: LocationUnifiedItem[];
|
|
432
|
+
total: number;
|
|
433
|
+
current: number;
|
|
434
|
+
size: number;
|
|
435
|
+
}>;
|
|
436
|
+
};
|
|
437
|
+
airport: {
|
|
438
|
+
searchByName: (params: SearchWithScopeParams) => Promise<{
|
|
439
|
+
records: LocationUnifiedItem[];
|
|
440
|
+
total: number;
|
|
441
|
+
current: number;
|
|
442
|
+
size: number;
|
|
443
|
+
}>;
|
|
444
|
+
getByIds: (ids: number[]) => Promise<{
|
|
445
|
+
records: LocationUnifiedItem[];
|
|
446
|
+
total: number;
|
|
447
|
+
current: number;
|
|
448
|
+
size: number;
|
|
449
|
+
}>;
|
|
450
|
+
};
|
|
451
|
+
wharf: {
|
|
452
|
+
getByIds: (ids: string[]) => Promise<{
|
|
453
|
+
records: LocationUnifiedItem[];
|
|
454
|
+
total: number;
|
|
455
|
+
current: number;
|
|
456
|
+
size: number;
|
|
457
|
+
}>;
|
|
458
|
+
};
|
|
459
|
+
carrier: {
|
|
460
|
+
/**
|
|
461
|
+
* 内部私有方法:构建符合 Carrier 接口要求的 payload
|
|
462
|
+
*/
|
|
463
|
+
_buildPayload: (params: Partial<SearchByNameParams> & {
|
|
464
|
+
ids?: number[];
|
|
465
|
+
}, lineType: "air" | "shipping") => CarrierRequestPayload;
|
|
466
|
+
/**
|
|
467
|
+
* 搜索船公司 (Shipping Line)
|
|
468
|
+
*/
|
|
469
|
+
searchShipping: (params: SearchByNameParams) => Promise<{
|
|
470
|
+
records: LocationUnifiedItem[];
|
|
471
|
+
total: number;
|
|
472
|
+
current: number;
|
|
473
|
+
size: number;
|
|
474
|
+
}>;
|
|
475
|
+
/**
|
|
476
|
+
* 搜索航空公司 (Airline)
|
|
477
|
+
*/
|
|
478
|
+
searchAir: (params: SearchByNameParams) => Promise<{
|
|
479
|
+
records: LocationUnifiedItem[];
|
|
480
|
+
total: number;
|
|
481
|
+
current: number;
|
|
482
|
+
size: number;
|
|
483
|
+
}>;
|
|
484
|
+
/**
|
|
485
|
+
* 通用搜索 (需要手动传入 type)
|
|
486
|
+
* 场景:如果前端有一个下拉框让用户选类型,则调用此方法
|
|
487
|
+
*/
|
|
488
|
+
search: (params: SearchByNameParams, lineType: "air" | "shipping") => Promise<{
|
|
489
|
+
records: LocationUnifiedItem[];
|
|
490
|
+
total: number;
|
|
491
|
+
current: number;
|
|
492
|
+
size: number;
|
|
493
|
+
}>;
|
|
494
|
+
/**
|
|
495
|
+
* 根据 ID 获取详情
|
|
496
|
+
* 注意:根据你的 Interface,ID 查询可能也需要传 lineType,
|
|
497
|
+
* 默认设为 shipping,或者你需要拆分成两个 ID 方法
|
|
498
|
+
*/
|
|
499
|
+
getByIds: (ids: number[], lineType?: "air" | "shipping") => Promise<{
|
|
500
|
+
records: LocationUnifiedItem[];
|
|
501
|
+
total: number;
|
|
502
|
+
current: number;
|
|
503
|
+
size: number;
|
|
504
|
+
}>;
|
|
505
|
+
};
|
|
506
|
+
line: {
|
|
507
|
+
/**
|
|
508
|
+
* 内部私有方法:构建符合后端要求的 Payload
|
|
509
|
+
*/
|
|
510
|
+
_buildPayload: (params: Partial<SearchByNameParams> & {
|
|
511
|
+
ids?: number[];
|
|
512
|
+
}, lineType: "air" | "shipping") => LineRequestPayload;
|
|
513
|
+
/**
|
|
514
|
+
* 搜索海运航线 (Shipping Line)
|
|
515
|
+
* 例如:AE1, TP9
|
|
516
|
+
*/
|
|
517
|
+
searchShipping: (params: SearchByNameParams) => Promise<{
|
|
518
|
+
records: LocationUnifiedItem[];
|
|
519
|
+
total: number;
|
|
520
|
+
current: number;
|
|
521
|
+
size: number;
|
|
522
|
+
}>;
|
|
523
|
+
/**
|
|
524
|
+
* 搜索空运航线 (Air Line)
|
|
525
|
+
* 业务上较少见,但接口支持
|
|
526
|
+
*/
|
|
527
|
+
searchAir: (params: SearchByNameParams) => Promise<{
|
|
528
|
+
records: LocationUnifiedItem[];
|
|
529
|
+
total: number;
|
|
530
|
+
current: number;
|
|
531
|
+
size: number;
|
|
532
|
+
}>;
|
|
533
|
+
/**
|
|
534
|
+
* 通用搜索 (需要手动传 lineType)
|
|
535
|
+
*/
|
|
536
|
+
search: (params: SearchByNameParams, lineType: "air" | "shipping") => Promise<{
|
|
537
|
+
records: LocationUnifiedItem[];
|
|
538
|
+
total: number;
|
|
539
|
+
current: number;
|
|
540
|
+
size: number;
|
|
541
|
+
}>;
|
|
542
|
+
/**
|
|
543
|
+
* 根据 ID 获取航线详情
|
|
544
|
+
* 默认默认为 shipping,如需查空运航线需显式传入
|
|
545
|
+
*/
|
|
546
|
+
getByIds: (ids: number[], lineType?: "air" | "shipping") => Promise<{
|
|
547
|
+
records: LocationUnifiedItem[];
|
|
548
|
+
total: number;
|
|
549
|
+
current: number;
|
|
550
|
+
size: number;
|
|
551
|
+
}>;
|
|
552
|
+
};
|
|
553
|
+
/** 获取某个国家下的所有城市 */
|
|
554
|
+
getCitiesByCountry: (countryId: number, params?: PageParams) => Promise<{
|
|
555
|
+
records: LocationUnifiedItem[];
|
|
556
|
+
total: number;
|
|
557
|
+
current: number;
|
|
558
|
+
size: number;
|
|
559
|
+
}>;
|
|
560
|
+
/** 获取某个城市下的子实体 */
|
|
561
|
+
getChildrenByCity: (cityId: number, childTypes: Array<"Seaport" | "Airport" | "Wharf">, params?: PageParams) => Promise<{
|
|
562
|
+
records: LocationUnifiedItem[];
|
|
563
|
+
total: number;
|
|
564
|
+
current: number;
|
|
565
|
+
size: number;
|
|
566
|
+
}>;
|
|
567
|
+
};
|
|
568
|
+
|
|
569
|
+
export declare type LocationType = "Continent" | "Country" | "Region" | "Province" | "City" | "Seaport" | "Airport" | "Street" | "Town" | "Wharf" | "Carrier" | "Line";
|
|
570
|
+
|
|
571
|
+
export declare interface LocationUnifiedItem {
|
|
572
|
+
id: number | string;
|
|
573
|
+
type: LocationType;
|
|
574
|
+
nameCn?: string;
|
|
575
|
+
nameEn?: string;
|
|
576
|
+
display?: string;
|
|
577
|
+
displayEn?: string;
|
|
578
|
+
displayCn?: string;
|
|
579
|
+
/** * 通用代码字段 (自动取 scacCode 或 carrierCode)
|
|
580
|
+
* 适用于仅展示用途
|
|
581
|
+
*/
|
|
582
|
+
code?: string;
|
|
583
|
+
/** * SCAC 代码 (Standard Carrier Alpha Code) - 通常用于船司
|
|
584
|
+
*/
|
|
585
|
+
scacCode?: string;
|
|
586
|
+
/** * IATA 代码 - 通常用于航司
|
|
587
|
+
*/
|
|
588
|
+
iataCode?: string;
|
|
589
|
+
/** * 承运人通用代码
|
|
590
|
+
*/
|
|
591
|
+
carrierCode?: string;
|
|
592
|
+
/** * 承运人类型: 'air' | 'shipping'
|
|
593
|
+
*/
|
|
594
|
+
lineType?: string;
|
|
595
|
+
continent?: Record<string, any>;
|
|
596
|
+
country?: Record<string, any>;
|
|
597
|
+
city?: Record<string, any>;
|
|
598
|
+
province?: Record<string, any>;
|
|
599
|
+
raw?: any;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
export declare function loginApi(loginData: LoginDataParams): Promise<IResponse<ApiResponse<LoginResponseData>>>;
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* 验证码登录注册
|
|
606
|
+
* @param data
|
|
607
|
+
* @returns
|
|
608
|
+
*/
|
|
609
|
+
export declare function loginByEmailOrMobileCodeApi(data: any): Promise<IResponse<ApiResponse<LoginResponseData>>>;
|
|
610
|
+
|
|
611
|
+
export declare function loginByFacebookApi(data: any): Promise<IResponse<ApiResponse<ThirdResponseData>>>;
|
|
612
|
+
|
|
613
|
+
export declare function loginByLinkedinApi(data: any): Promise<IResponse<ApiResponse<ThirdResponseData>>>;
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* 微信二维码登录(1s轮询)
|
|
617
|
+
* @param data
|
|
618
|
+
* @returns
|
|
619
|
+
*/
|
|
620
|
+
export declare function loginByQrCode(data: {
|
|
621
|
+
uniqueCode: string;
|
|
622
|
+
appId: string;
|
|
623
|
+
redirectPath: string;
|
|
624
|
+
kick: boolean;
|
|
625
|
+
}): Promise<any>;
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* 微信二维码登录绑定用户(验证码)
|
|
629
|
+
* @param data
|
|
630
|
+
* @returns
|
|
631
|
+
*/
|
|
632
|
+
export declare function loginCodeBindWechatApi(data: any): Promise<any>;
|
|
633
|
+
|
|
634
|
+
declare interface LoginDataParams {
|
|
635
|
+
username: string;
|
|
636
|
+
password: string;
|
|
637
|
+
appId: string;
|
|
638
|
+
code: string;
|
|
639
|
+
uuid: string;
|
|
640
|
+
kick: boolean;
|
|
641
|
+
redirectPath: string;
|
|
642
|
+
activityCode: string;
|
|
643
|
+
referenceUserId: string;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* 微信二维码登录绑定用户(账号密码)
|
|
648
|
+
* @param data
|
|
649
|
+
* @returns
|
|
650
|
+
*/
|
|
651
|
+
export declare function loginPwdBindWechatApi(data: any): Promise<any>;
|
|
652
|
+
|
|
653
|
+
declare interface LoginResponseData {
|
|
654
|
+
redirect: boolean;
|
|
655
|
+
redirectPath?: string;
|
|
656
|
+
tgc?: string;
|
|
657
|
+
result?: LoginResult;
|
|
658
|
+
hasLogon?: boolean;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
declare interface LoginResult {
|
|
662
|
+
accessToken: string;
|
|
663
|
+
expireIn: number;
|
|
664
|
+
refreshToken: string;
|
|
665
|
+
refreshTokenExpireIn: number;
|
|
666
|
+
improveComp: boolean;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
export declare const MODAL_ACTION: {
|
|
670
|
+
readonly Open: "GLOBAL_MODAL_OPEN";
|
|
671
|
+
readonly Close: "GLOBAL_MODAL_CLOSE";
|
|
672
|
+
readonly Submit: "GLOBAL_MODAL_SUBMIT";
|
|
673
|
+
};
|
|
674
|
+
|
|
675
|
+
export declare type ModalEvents = Record<ActionKeys, any> & {
|
|
676
|
+
[MODAL_ACTION.Open]: ModalOpenCallback | undefined;
|
|
677
|
+
[MODAL_ACTION.Close]: undefined;
|
|
678
|
+
[MODAL_ACTION.Submit]: any;
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
export declare type ModalOpenCallback = () => void;
|
|
682
|
+
|
|
683
|
+
export declare interface PageParams {
|
|
684
|
+
current?: number;
|
|
685
|
+
size?: number;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
export declare const PrjId = "prjId";
|
|
689
|
+
|
|
690
|
+
export declare const RefreshExpiresInKey = "JC-Refresh-Expires-In";
|
|
691
|
+
|
|
692
|
+
export declare const RefreshExpiresInTimeKey = "JC-Refresh-Expires-Time-In";
|
|
693
|
+
|
|
694
|
+
export declare const RefreshTokenKey = "JC-Refresh-Token";
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* 国际站峰会注册
|
|
698
|
+
* @param data
|
|
699
|
+
* @returns
|
|
700
|
+
*/
|
|
701
|
+
export declare function registerApi(data: any): Promise<any>;
|
|
702
|
+
|
|
703
|
+
export declare function registerByThirdPartyApi(data: any): Promise<any>;
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* 用户注册加入公司
|
|
707
|
+
* @param data
|
|
708
|
+
* @returns
|
|
709
|
+
*/
|
|
710
|
+
export declare function registerJoinCompanyApi(data: any): Promise<any>;
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* 微信二维码登录用户注册加入公司 🍉
|
|
714
|
+
* @param data
|
|
715
|
+
* @returns
|
|
716
|
+
*/
|
|
717
|
+
export declare function registerJoinCompanyBindWechatApi(data: any): Promise<any>;
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* 第三方应用注册加入公司
|
|
721
|
+
* @param data
|
|
722
|
+
* @returns
|
|
723
|
+
*/
|
|
724
|
+
export declare function registerJoinCompByThirdPartyApi(data: any): Promise<any>;
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* 微信二维码登录注册用户公司
|
|
728
|
+
* @param data
|
|
729
|
+
* @returns
|
|
730
|
+
*/
|
|
731
|
+
export declare function registerUserCompBindWechatApi(data: any): Promise<any>;
|
|
732
|
+
|
|
733
|
+
export declare const RememberMeAccountKey = "JC-Remember-Account";
|
|
734
|
+
|
|
735
|
+
export declare const RememberMePasswordKey = "JC-Remember-Password";
|
|
736
|
+
|
|
737
|
+
export declare interface reportNewTypeData {
|
|
738
|
+
reportData: string;
|
|
739
|
+
reportType: ReportType;
|
|
740
|
+
countryId?: string | number;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
export declare function reportNewTypeDataApi(payload: reportNewTypeData): Promise<{}>;
|
|
744
|
+
|
|
745
|
+
export declare type ReportType = "City" | "Seaport" | "Airport" | "Line";
|
|
746
|
+
|
|
747
|
+
declare interface RequestAdapter {
|
|
748
|
+
get(url: string, config?: RequestConfig): Promise<any>;
|
|
749
|
+
post(url: string, data?: any, config?: RequestConfig): Promise<any>;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
declare interface RequestConfig {
|
|
753
|
+
params?: Record<string, any>;
|
|
754
|
+
headers?: Record<string, string>;
|
|
755
|
+
isToken?: boolean;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
declare type RequestDriver = "axios" | "fetch";
|
|
759
|
+
|
|
760
|
+
declare interface RequestOptions {
|
|
761
|
+
onUnauthorized?: () => void;
|
|
762
|
+
baseURL?: string;
|
|
763
|
+
fetch?: typeof fetch;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* 重置 session
|
|
768
|
+
*/
|
|
769
|
+
export declare function resetAuthSessionItems(): void;
|
|
770
|
+
|
|
771
|
+
export declare function resetPasswordApi(data: any): Promise<any>;
|
|
772
|
+
|
|
773
|
+
/**
|
|
774
|
+
* 统一搜索接口
|
|
775
|
+
* - 支持 keyword(模糊), displayInfo(数组), ids(按 type), scope(countryId/cityId/provinceId)
|
|
776
|
+
* - 返回扁平化的 UnifiedItem 列表 + 分页信息
|
|
777
|
+
*/
|
|
778
|
+
export declare function search(params: {
|
|
779
|
+
keyword?: string;
|
|
780
|
+
displayInfo?: DisplayInfo[];
|
|
781
|
+
page?: number;
|
|
782
|
+
size?: number;
|
|
783
|
+
level?: 1 | 2 | 3 | 4;
|
|
784
|
+
sort?: string;
|
|
785
|
+
ids?: {
|
|
786
|
+
type: DisplayInfo;
|
|
787
|
+
ids: number[];
|
|
788
|
+
}[];
|
|
789
|
+
scope?: {
|
|
790
|
+
countryId?: number;
|
|
791
|
+
cityId?: number;
|
|
792
|
+
provinceId?: number;
|
|
793
|
+
};
|
|
794
|
+
extraAppoint?: AppointSearch[];
|
|
795
|
+
}): Promise<BaseResponse<UnifiedItem>>;
|
|
796
|
+
|
|
797
|
+
export declare function searchAirportByName(keyword: string, opts?: {
|
|
798
|
+
page?: number;
|
|
799
|
+
size?: number;
|
|
800
|
+
cityId?: number;
|
|
801
|
+
}): Promise<BaseResponse<UnifiedItem>>;
|
|
802
|
+
|
|
803
|
+
/**
|
|
804
|
+
* 按名称搜索指定类型
|
|
805
|
+
*/
|
|
806
|
+
export declare function searchByName(params: {
|
|
807
|
+
keyword: string;
|
|
808
|
+
types?: DisplayInfo[];
|
|
809
|
+
page?: number;
|
|
810
|
+
size?: number;
|
|
811
|
+
level?: 1 | 2 | 3 | 4;
|
|
812
|
+
sort?: string;
|
|
813
|
+
}): Promise<BaseResponse<UnifiedItem>>;
|
|
814
|
+
|
|
815
|
+
export declare interface SearchByNameParams extends PageParams {
|
|
816
|
+
keyword: string;
|
|
817
|
+
searchMode?: "0" | "1" | "2";
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
export declare function searchCityByName(keyword: string, opts?: {
|
|
821
|
+
page?: number;
|
|
822
|
+
size?: number;
|
|
823
|
+
countryId?: number;
|
|
824
|
+
}): Promise<BaseResponse<UnifiedItem>>;
|
|
825
|
+
|
|
826
|
+
export declare function searchCountryByName(keyword: string, opts?: {
|
|
827
|
+
page?: number;
|
|
828
|
+
size?: number;
|
|
829
|
+
}): Promise<BaseResponse<UnifiedItem>>;
|
|
830
|
+
|
|
831
|
+
export declare interface SearchGenericParams extends SearchByNameParams {
|
|
832
|
+
displayInfo: LocationType[];
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
export declare function searchSeaportByName(keyword: string, opts?: {
|
|
836
|
+
page?: number;
|
|
837
|
+
size?: number;
|
|
838
|
+
cityId?: number;
|
|
839
|
+
}): Promise<BaseResponse<UnifiedItem>>;
|
|
840
|
+
|
|
841
|
+
export declare interface SearchWithScopeParams extends SearchByNameParams {
|
|
842
|
+
countryId?: number;
|
|
843
|
+
cityId?: number;
|
|
844
|
+
provinceId?: number;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* 发送邮箱验证码
|
|
849
|
+
* @param data
|
|
850
|
+
* @returns
|
|
851
|
+
*/
|
|
852
|
+
export declare function sendEmailCodeApi(data: {
|
|
853
|
+
target: string;
|
|
854
|
+
countryId?: number;
|
|
855
|
+
account?: string;
|
|
856
|
+
uuid?: string;
|
|
857
|
+
}): Promise<any>;
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* 发送手机验证码
|
|
861
|
+
* @param data
|
|
862
|
+
* @returns
|
|
863
|
+
*/
|
|
864
|
+
export declare function sendMobileCodeApi(data: {
|
|
865
|
+
target: string;
|
|
866
|
+
countryId?: number;
|
|
867
|
+
account?: string;
|
|
868
|
+
uuid?: string;
|
|
869
|
+
}): Promise<any>;
|
|
870
|
+
|
|
871
|
+
/**
|
|
872
|
+
* 全局设置 session
|
|
873
|
+
* @param data
|
|
874
|
+
*/
|
|
875
|
+
export declare function setAuthSessionItems(data: {
|
|
876
|
+
activityCode?: string | null;
|
|
877
|
+
referenceUserId?: string | null;
|
|
878
|
+
empNo?: string | null;
|
|
879
|
+
uniqueCode?: string | null;
|
|
880
|
+
path?: string | null;
|
|
881
|
+
clickSource?: string | null;
|
|
882
|
+
registerEvent?: string | null;
|
|
883
|
+
registerType?: string | null;
|
|
884
|
+
compKey?: string | null;
|
|
885
|
+
}): void;
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* 记住账号 (替代存密码)
|
|
889
|
+
*/
|
|
890
|
+
export declare function setRememberMe(account: string, password: string, remember: boolean): void;
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* 整体设置所有凭证
|
|
894
|
+
*/
|
|
895
|
+
export declare function setTokenAll(data: TokenData | null | undefined): void;
|
|
896
|
+
|
|
897
|
+
export declare interface SharedConfig {
|
|
898
|
+
prefixPath: string;
|
|
899
|
+
searchPath: string;
|
|
900
|
+
oldSearchPath: string;
|
|
901
|
+
carrierPath: string;
|
|
902
|
+
linePath: string;
|
|
903
|
+
appId?: string;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
export declare function slideCheckApi(data: {
|
|
907
|
+
pointJson: string;
|
|
908
|
+
uuid: string;
|
|
909
|
+
}): Promise<any>;
|
|
910
|
+
|
|
911
|
+
export declare function slideGetApi(data: {
|
|
912
|
+
clientUid: string;
|
|
913
|
+
ts: number;
|
|
914
|
+
}): Promise<any>;
|
|
915
|
+
|
|
916
|
+
declare interface ThirdPartyInfo {
|
|
917
|
+
thirdPartyEmail: string;
|
|
918
|
+
thirdPartyId: string;
|
|
919
|
+
thirdPartyType: string;
|
|
920
|
+
thirdPartyUserName: string;
|
|
921
|
+
[property: string]: any;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
declare interface ThirdResponseData {
|
|
925
|
+
/**
|
|
926
|
+
* 手机邮箱匹配列表 (修正为数组)
|
|
927
|
+
*/
|
|
928
|
+
mobileEmailList: ThirdResponseMobileEmailList[];
|
|
929
|
+
/**
|
|
930
|
+
* 是否跳转, true跳转 false不跳转
|
|
931
|
+
*/
|
|
932
|
+
redirect: boolean;
|
|
933
|
+
/**
|
|
934
|
+
* 跳转路径
|
|
935
|
+
*/
|
|
936
|
+
redirectPath: string;
|
|
937
|
+
/**
|
|
938
|
+
* tgc
|
|
939
|
+
*/
|
|
940
|
+
tgc: string;
|
|
941
|
+
/**
|
|
942
|
+
* 三方信息
|
|
943
|
+
*/
|
|
944
|
+
thirdPartyInfo: ThirdPartyInfo;
|
|
945
|
+
[property: string]: any;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
declare interface ThirdResponseMobileEmailList {
|
|
949
|
+
account: string;
|
|
950
|
+
cityId: number;
|
|
951
|
+
cityNameCn: string;
|
|
952
|
+
cityNameEn: string;
|
|
953
|
+
compNameCn: string;
|
|
954
|
+
compNameEn: string;
|
|
955
|
+
countryId: number;
|
|
956
|
+
countryNameCn: string;
|
|
957
|
+
countryNameEn: string;
|
|
958
|
+
email: string;
|
|
959
|
+
mobile: string;
|
|
960
|
+
userId: number;
|
|
961
|
+
userNameCn: string;
|
|
962
|
+
userNameEn: string;
|
|
963
|
+
[property: string]: any;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
export declare const TOKEN_ENDPOINTS: Set<string>;
|
|
967
|
+
|
|
968
|
+
/**
|
|
969
|
+
* 3. 类型定义
|
|
970
|
+
*/
|
|
971
|
+
export declare interface TokenData {
|
|
972
|
+
accessToken?: string;
|
|
973
|
+
expireIn?: number;
|
|
974
|
+
refreshToken?: string;
|
|
975
|
+
refreshTokenExpireIn?: number;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
/**
|
|
979
|
+
* 2. 常量定义 (补全所有业务 Key)
|
|
980
|
+
*/
|
|
981
|
+
export declare const TokenKey = "JC-JAVA-Token-Root";
|
|
982
|
+
|
|
983
|
+
/** 归一化之后的实体 */
|
|
984
|
+
export declare interface UnifiedItem {
|
|
985
|
+
id: number | string;
|
|
986
|
+
type: DisplayInfo;
|
|
987
|
+
nameCn?: string;
|
|
988
|
+
nameEn?: string;
|
|
989
|
+
display?: string;
|
|
990
|
+
continent?: Record<string, any>;
|
|
991
|
+
country?: Record<string, any>;
|
|
992
|
+
city?: Record<string, any>;
|
|
993
|
+
province?: Record<string, any>;
|
|
994
|
+
raw?: any;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* 验证账号是否存在 /auth/validateAccountExist
|
|
999
|
+
* @param data
|
|
1000
|
+
* @returns
|
|
1001
|
+
*/
|
|
1002
|
+
export declare function validateAccountExistApi(data: {
|
|
1003
|
+
target: string;
|
|
1004
|
+
}): Promise<any>;
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* 校验注册公司是否重名
|
|
1008
|
+
* @param data
|
|
1009
|
+
* @returns
|
|
1010
|
+
*/
|
|
1011
|
+
export declare function validateCompanyApi(data: {
|
|
1012
|
+
countryId: number;
|
|
1013
|
+
cityId: number;
|
|
1014
|
+
compNameCn?: string;
|
|
1015
|
+
compNameEn?: string;
|
|
1016
|
+
}): Promise<any>;
|
|
1017
|
+
|
|
1018
|
+
export { }
|