@jctrans-materials/shared 1.0.22 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +6 -6
- package/dist/index.esm.js +713 -709
- package/package.json +1 -1
- package/dist/api/applyData.d.ts +0 -8
- package/dist/api/auth.d.ts +0 -227
- package/dist/api/baseSearch.d.ts +0 -161
- package/dist/api/common.d.ts +0 -20
- package/dist/api/searchV2.d.ts +0 -273
- package/dist/api/type.d.ts +0 -86
- package/dist/config/index.d.ts +0 -34
- package/dist/index.d.ts +0 -24
- package/dist/utils/common.d.ts +0 -67
- package/dist/utils/crypto/index.d.ts +0 -2
- package/dist/utils/request/adapters/axios.d.ts +0 -2
- package/dist/utils/request/adapters/fetch.d.ts +0 -6
- package/dist/utils/request/index.d.ts +0 -7
- package/dist/utils/request/types.d.ts +0 -15
package/dist/api/type.d.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
export interface LoginResult {
|
|
2
|
-
accessToken: string;
|
|
3
|
-
expireIn: number;
|
|
4
|
-
refreshToken: string;
|
|
5
|
-
refreshTokenExpireIn: number;
|
|
6
|
-
improveComp: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface LoginResponseData {
|
|
9
|
-
redirect: boolean;
|
|
10
|
-
redirectPath?: string;
|
|
11
|
-
tgc?: string;
|
|
12
|
-
result?: LoginResult;
|
|
13
|
-
hasLogon?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface ApiResponse<T = any> {
|
|
16
|
-
code: number;
|
|
17
|
-
msg: string;
|
|
18
|
-
data: T;
|
|
19
|
-
}
|
|
20
|
-
export interface IResponse<T> {
|
|
21
|
-
data: T;
|
|
22
|
-
}
|
|
23
|
-
export interface LoginDataParams {
|
|
24
|
-
username: string;
|
|
25
|
-
password: string;
|
|
26
|
-
appId: string;
|
|
27
|
-
code: string;
|
|
28
|
-
uuid: string;
|
|
29
|
-
kick: boolean;
|
|
30
|
-
redirectPath: string;
|
|
31
|
-
activityCode: string;
|
|
32
|
-
referenceUserId: string;
|
|
33
|
-
}
|
|
34
|
-
export interface ThirdResponse {
|
|
35
|
-
code: number;
|
|
36
|
-
data: ThirdResponseData;
|
|
37
|
-
msg: string;
|
|
38
|
-
[property: string]: any;
|
|
39
|
-
}
|
|
40
|
-
export interface ThirdResponseData {
|
|
41
|
-
/**
|
|
42
|
-
* 手机邮箱匹配列表 (修正为数组)
|
|
43
|
-
*/
|
|
44
|
-
mobileEmailList: ThirdResponseMobileEmailList[];
|
|
45
|
-
/**
|
|
46
|
-
* 是否跳转, true跳转 false不跳转
|
|
47
|
-
*/
|
|
48
|
-
redirect: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* 跳转路径
|
|
51
|
-
*/
|
|
52
|
-
redirectPath: string;
|
|
53
|
-
/**
|
|
54
|
-
* tgc
|
|
55
|
-
*/
|
|
56
|
-
tgc: string;
|
|
57
|
-
/**
|
|
58
|
-
* 三方信息
|
|
59
|
-
*/
|
|
60
|
-
thirdPartyInfo: ThirdPartyInfo;
|
|
61
|
-
[property: string]: any;
|
|
62
|
-
}
|
|
63
|
-
export interface ThirdResponseMobileEmailList {
|
|
64
|
-
account: string;
|
|
65
|
-
cityId: number;
|
|
66
|
-
cityNameCn: string;
|
|
67
|
-
cityNameEn: string;
|
|
68
|
-
compNameCn: string;
|
|
69
|
-
compNameEn: string;
|
|
70
|
-
countryId: number;
|
|
71
|
-
countryNameCn: string;
|
|
72
|
-
countryNameEn: string;
|
|
73
|
-
email: string;
|
|
74
|
-
mobile: string;
|
|
75
|
-
userId: number;
|
|
76
|
-
userNameCn: string;
|
|
77
|
-
userNameEn: string;
|
|
78
|
-
[property: string]: any;
|
|
79
|
-
}
|
|
80
|
-
export interface ThirdPartyInfo {
|
|
81
|
-
thirdPartyEmail: string;
|
|
82
|
-
thirdPartyId: string;
|
|
83
|
-
thirdPartyType: string;
|
|
84
|
-
thirdPartyUserName: string;
|
|
85
|
-
[property: string]: any;
|
|
86
|
-
}
|
package/dist/config/index.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export interface SharedConfig {
|
|
2
|
-
prefixPath: string;
|
|
3
|
-
searchPath: string;
|
|
4
|
-
oldSearchPath: string;
|
|
5
|
-
carrierPath: string;
|
|
6
|
-
linePath: string;
|
|
7
|
-
appId?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const currentConfig: {
|
|
10
|
-
readonly basePath: string;
|
|
11
|
-
readonly carrierPath: string;
|
|
12
|
-
readonly linePath: string;
|
|
13
|
-
readonly oldBasePath: string;
|
|
14
|
-
readonly prefixPath: string;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* 全局初始化方法,在项目入口调用
|
|
18
|
-
*/
|
|
19
|
-
export declare const initSharedConfig: (newConfig: Partial<SharedConfig>) => void;
|
|
20
|
-
/**
|
|
21
|
-
* 获取当前配置
|
|
22
|
-
*/
|
|
23
|
-
export declare const getSharedConfig: () => {
|
|
24
|
-
readonly basePath: string;
|
|
25
|
-
readonly carrierPath: string;
|
|
26
|
-
readonly linePath: string;
|
|
27
|
-
readonly oldBasePath: string;
|
|
28
|
-
readonly prefixPath: string;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* 兼容全环境的语言判断方法
|
|
32
|
-
* 逻辑优先级:Nuxt Composables > 浏览器 Cookie > Nuxt SSR 上下文
|
|
33
|
-
*/
|
|
34
|
-
export declare const getIsEn: () => boolean;
|
package/dist/index.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Emitter } from 'mitt';
|
|
2
|
-
export declare const MODAL_ACTION: {
|
|
3
|
-
readonly Open: "GLOBAL_MODAL_OPEN";
|
|
4
|
-
readonly Close: "GLOBAL_MODAL_CLOSE";
|
|
5
|
-
readonly Submit: "GLOBAL_MODAL_SUBMIT";
|
|
6
|
-
};
|
|
7
|
-
type ActionKeys = (typeof MODAL_ACTION)[keyof typeof MODAL_ACTION];
|
|
8
|
-
type ModalOpenCallback = () => void;
|
|
9
|
-
export type ModalEvents = Record<ActionKeys, any> & {
|
|
10
|
-
[MODAL_ACTION.Open]: ModalOpenCallback | undefined;
|
|
11
|
-
[MODAL_ACTION.Close]: undefined;
|
|
12
|
-
[MODAL_ACTION.Submit]: any;
|
|
13
|
-
};
|
|
14
|
-
declare const emitter: Emitter<ModalEvents>;
|
|
15
|
-
export * from './api/baseSearch';
|
|
16
|
-
export * from './utils/request';
|
|
17
|
-
export * from './utils/crypto';
|
|
18
|
-
export * from './utils/common';
|
|
19
|
-
export * from './api/searchV2';
|
|
20
|
-
export * from './config/index';
|
|
21
|
-
export * from './api/applyData';
|
|
22
|
-
export * from './api/common';
|
|
23
|
-
export * from './api/auth';
|
|
24
|
-
export { emitter };
|
package/dist/utils/common.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 判断域名是否为 IP
|
|
3
|
-
*/
|
|
4
|
-
export declare function isIpAddress(hostname: string): boolean;
|
|
5
|
-
/**
|
|
6
|
-
* 获取一级域名 (用于 Cookie 跨域共享)
|
|
7
|
-
*/
|
|
8
|
-
export declare function getFirstDomain(): string | undefined;
|
|
9
|
-
/**
|
|
10
|
-
* 2. 常量定义 (补全所有业务 Key)
|
|
11
|
-
*/
|
|
12
|
-
export declare const TokenKey = "JC-JAVA-Token-Root";
|
|
13
|
-
export declare const HasLoginKey = "hasLogin";
|
|
14
|
-
export declare const PrjId = "prjId";
|
|
15
|
-
export declare const ExpiresInKey = "JC-Expires-In";
|
|
16
|
-
export declare const ExpiresInTimeKey = "JC-Expires-Time-In";
|
|
17
|
-
export declare const RefreshTokenKey = "JC-Refresh-Token";
|
|
18
|
-
export declare const RefreshExpiresInKey = "JC-Refresh-Expires-In";
|
|
19
|
-
export declare const RefreshExpiresInTimeKey = "JC-Refresh-Expires-Time-In";
|
|
20
|
-
export declare const RememberMeAccountKey = "JC-Remember-Account";
|
|
21
|
-
/**
|
|
22
|
-
* 3. 类型定义
|
|
23
|
-
*/
|
|
24
|
-
export interface TokenData {
|
|
25
|
-
accessToken?: string;
|
|
26
|
-
expireIn?: number;
|
|
27
|
-
refreshToken?: string;
|
|
28
|
-
refreshTokenExpireIn?: number;
|
|
29
|
-
}
|
|
30
|
-
export declare const TOKEN_ENDPOINTS: Set<string>;
|
|
31
|
-
/**
|
|
32
|
-
* 4. 导出操作方法
|
|
33
|
-
*/
|
|
34
|
-
export declare function getProjectId(): string | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* 记住账号 (替代存密码)
|
|
37
|
-
*/
|
|
38
|
-
export declare function setRememberMe(account: string, remember: boolean): void;
|
|
39
|
-
/**
|
|
40
|
-
* 整体设置所有凭证
|
|
41
|
-
*/
|
|
42
|
-
export declare function setTokenAll(data: TokenData | null | undefined): void;
|
|
43
|
-
export declare function clearAllAuth(): void;
|
|
44
|
-
/**
|
|
45
|
-
* 跨环境获取 AppId (兼容 Vite, Webpack, Nuxt)
|
|
46
|
-
*/
|
|
47
|
-
export declare function getAppId(): string;
|
|
48
|
-
/**
|
|
49
|
-
* 跨环境获取 Path
|
|
50
|
-
*/
|
|
51
|
-
export declare function getPathFromConfig(config: any): string;
|
|
52
|
-
/**
|
|
53
|
-
* 获取当前的 Access Token
|
|
54
|
-
*/
|
|
55
|
-
export declare function getToken(): string | undefined;
|
|
56
|
-
/**
|
|
57
|
-
* 🚀 补全:获取当前的 Refresh Token
|
|
58
|
-
*/
|
|
59
|
-
export declare function getRefreshToken(): string | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* 🚀 补全:获取 Access Token 的过期时间戳 (用于判断是否需要刷新)
|
|
62
|
-
*/
|
|
63
|
-
export declare function getExpiresTimeIn(): number;
|
|
64
|
-
/**
|
|
65
|
-
* 获取记住的账号
|
|
66
|
-
*/
|
|
67
|
-
export declare function getRememberAccount(): string | undefined;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { RequestAdapter, RequestDriver, RequestOptions } from './types';
|
|
2
|
-
export declare function createRequest(driver: RequestDriver, options?: RequestOptions): RequestAdapter;
|
|
3
|
-
declare const request: {
|
|
4
|
-
get: (url: string, config?: import('./types').RequestConfig | undefined) => Promise<any>;
|
|
5
|
-
post: (url: string, data?: any, config?: import('./types').RequestConfig | undefined) => Promise<any>;
|
|
6
|
-
};
|
|
7
|
-
export default request;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface RequestConfig {
|
|
2
|
-
params?: Record<string, any>;
|
|
3
|
-
headers?: Record<string, string>;
|
|
4
|
-
isToken?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface RequestOptions {
|
|
7
|
-
onUnauthorized?: () => void;
|
|
8
|
-
baseURL?: string;
|
|
9
|
-
fetch?: typeof fetch;
|
|
10
|
-
}
|
|
11
|
-
export interface RequestAdapter {
|
|
12
|
-
get(url: string, config?: RequestConfig): Promise<any>;
|
|
13
|
-
post(url: string, data?: any, config?: RequestConfig): Promise<any>;
|
|
14
|
-
}
|
|
15
|
-
export type RequestDriver = "axios" | "fetch";
|