@ibiz-template/core 0.0.1-alpha.1 → 0.0.1-alpha.13
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/out/constant/http-status-message/http-status-message.d.ts +5 -0
- package/out/constant/http-status-message/http-status-message.d.ts.map +1 -0
- package/out/constant/http-status-message/http-status-message.js +20 -0
- package/out/constant/index.d.ts +1 -0
- package/out/constant/index.d.ts.map +1 -1
- package/out/constant/index.js +1 -0
- package/out/context/index.d.ts +10 -2
- package/out/context/index.d.ts.map +1 -1
- package/out/context/index.js +20 -4
- package/out/environment/environment.d.ts.map +1 -1
- package/out/environment/environment.js +6 -1
- package/out/error/http-error/http-error.d.ts +18 -0
- package/out/error/http-error/http-error.d.ts.map +1 -0
- package/out/error/http-error/http-error.js +36 -0
- package/out/error/index.d.ts +3 -0
- package/out/error/index.d.ts.map +1 -0
- package/out/error/index.js +2 -0
- package/out/error/runtime-error/runtime-error.d.ts +15 -0
- package/out/error/runtime-error/runtime-error.d.ts.map +1 -0
- package/out/error/runtime-error/runtime-error.js +15 -0
- package/out/ibizsys.d.ts +0 -7
- package/out/ibizsys.d.ts.map +1 -1
- package/out/ibizsys.js +1 -9
- package/out/index.d.ts +1 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -1
- package/out/install.d.ts.map +1 -1
- package/out/install.js +3 -2
- package/out/interface/i-environment/i-environment.d.ts +48 -1
- package/out/interface/i-environment/i-environment.d.ts.map +1 -1
- package/out/types.d.ts +10 -0
- package/out/types.d.ts.map +1 -1
- package/out/utils/index.d.ts +5 -2
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +4 -1
- package/out/utils/namespace/namespace.d.ts +148 -0
- package/out/utils/namespace/namespace.d.ts.map +1 -0
- package/out/utils/namespace/namespace.js +216 -0
- package/out/utils/net/http-response.d.ts +94 -0
- package/out/utils/net/http-response.d.ts.map +1 -0
- package/out/utils/net/http-response.js +53 -0
- package/out/utils/net/net.d.ts +16 -34
- package/out/utils/net/net.d.ts.map +1 -1
- package/out/utils/net/net.js +57 -28
- package/out/utils/plural/plural.d.ts +21 -0
- package/out/utils/plural/plural.d.ts.map +1 -0
- package/out/utils/plural/plural.js +25 -0
- package/out/utils/util/util.d.ts +29 -0
- package/out/utils/util/util.d.ts.map +1 -1
- package/out/utils/util/util.js +50 -0
- package/package.json +19 -9
- package/src/constant/http-status-message/http-status-message.ts +20 -0
- package/src/constant/index.ts +1 -0
- package/src/context/index.ts +24 -5
- package/src/environment/environment.ts +6 -1
- package/src/error/http-error/http-error.ts +43 -0
- package/src/error/index.ts +2 -0
- package/src/error/runtime-error/runtime-error.ts +14 -0
- package/src/ibizsys.ts +1 -10
- package/src/index.ts +1 -2
- package/src/install.ts +3 -2
- package/src/interface/i-environment/i-environment.ts +54 -2
- package/src/types.ts +11 -0
- package/src/utils/index.ts +5 -2
- package/src/utils/namespace/namespace.ts +244 -0
- package/src/utils/net/http-response.ts +113 -0
- package/src/utils/net/net.ts +67 -60
- package/src/utils/plural/plural.ts +27 -0
- package/src/utils/util/util.ts +64 -0
package/out/utils/util/util.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DebounceSettings } from 'lodash-es';
|
|
1
2
|
/**
|
|
2
3
|
* 获取认证令牌
|
|
3
4
|
*
|
|
@@ -7,4 +8,32 @@
|
|
|
7
8
|
* @return {*} {(string | null)}
|
|
8
9
|
*/
|
|
9
10
|
export declare function getToken(): string | null;
|
|
11
|
+
/**
|
|
12
|
+
* 判断两个数组是否有相同的元素
|
|
13
|
+
*
|
|
14
|
+
* @author lxm
|
|
15
|
+
* @date 2022-09-20 19:09:29
|
|
16
|
+
* @export
|
|
17
|
+
* @param {any[]} arr1
|
|
18
|
+
* @param {any[]} arr2
|
|
19
|
+
* @returns {*} {boolean}
|
|
20
|
+
*/
|
|
21
|
+
export declare function isOverlap(arr1: any[], arr2: any[]): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* 防抖并合并每次的参数
|
|
24
|
+
*
|
|
25
|
+
* @author lxm
|
|
26
|
+
* @date 2022-09-20 21:09:53
|
|
27
|
+
* @export
|
|
28
|
+
* @template T
|
|
29
|
+
* @param {T} func 要防抖的函数
|
|
30
|
+
* @param {(
|
|
31
|
+
* oldParams: Parameters<T>,
|
|
32
|
+
* newParams: Parameters<T>,
|
|
33
|
+
* ) => Parameters<T>} mergeFunc 合并的回调函数
|
|
34
|
+
* @param {number} [wait] 防抖的延迟毫秒数
|
|
35
|
+
* @param {DebounceSettings} [options] 防抖函数的额外参数
|
|
36
|
+
* @returns {*}
|
|
37
|
+
*/
|
|
38
|
+
export declare function debounceAndMerge<T extends (...args: any[]) => any>(func: T, mergeFunc: (oldParams: Parameters<T>, newParams: Parameters<T>) => Parameters<T>, wait?: number, options?: DebounceSettings): (...args: Parameters<T>) => any;
|
|
10
39
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/utils/util/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/utils/util/util.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAIvD;;;;;;;GAOG;AACH,wBAAgB,QAAQ,IAAI,MAAM,GAAG,IAAI,CAExC;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAG3D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAChE,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,CACT,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,EACxB,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,KACrB,UAAU,CAAC,CAAC,CAAC,EAClB,IAAI,CAAC,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,gBAAgB,aAaT,WAAW,CAAC,CAAC,SAS/B"}
|
package/out/utils/util/util.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { debounce } from 'lodash-es';
|
|
1
3
|
import { getCookie } from 'qx-util';
|
|
2
4
|
import { CoreConst } from '../../constant';
|
|
3
5
|
/**
|
|
@@ -11,3 +13,51 @@ import { CoreConst } from '../../constant';
|
|
|
11
13
|
export function getToken() {
|
|
12
14
|
return getCookie(CoreConst.TOKEN);
|
|
13
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* 判断两个数组是否有相同的元素
|
|
18
|
+
*
|
|
19
|
+
* @author lxm
|
|
20
|
+
* @date 2022-09-20 19:09:29
|
|
21
|
+
* @export
|
|
22
|
+
* @param {any[]} arr1
|
|
23
|
+
* @param {any[]} arr2
|
|
24
|
+
* @returns {*} {boolean}
|
|
25
|
+
*/
|
|
26
|
+
export function isOverlap(arr1, arr2) {
|
|
27
|
+
const newArr = Array.from(new Set([...arr1, ...arr2]));
|
|
28
|
+
return newArr.length !== arr1.length + arr2.length;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 防抖并合并每次的参数
|
|
32
|
+
*
|
|
33
|
+
* @author lxm
|
|
34
|
+
* @date 2022-09-20 21:09:53
|
|
35
|
+
* @export
|
|
36
|
+
* @template T
|
|
37
|
+
* @param {T} func 要防抖的函数
|
|
38
|
+
* @param {(
|
|
39
|
+
* oldParams: Parameters<T>,
|
|
40
|
+
* newParams: Parameters<T>,
|
|
41
|
+
* ) => Parameters<T>} mergeFunc 合并的回调函数
|
|
42
|
+
* @param {number} [wait] 防抖的延迟毫秒数
|
|
43
|
+
* @param {DebounceSettings} [options] 防抖函数的额外参数
|
|
44
|
+
* @returns {*}
|
|
45
|
+
*/
|
|
46
|
+
export function debounceAndMerge(func, mergeFunc, wait, options) {
|
|
47
|
+
// 缓存上一次的函数参数
|
|
48
|
+
let oldParams;
|
|
49
|
+
const debounceFunc = debounce((...params) => {
|
|
50
|
+
// 防抖函数执行的时候清空缓存参数
|
|
51
|
+
oldParams = undefined;
|
|
52
|
+
return func(...params);
|
|
53
|
+
}, wait, options);
|
|
54
|
+
return (...args) => {
|
|
55
|
+
// 合并参数,并把参数缓存到oldParams里,用新参数调用防抖函数
|
|
56
|
+
let newParams = args;
|
|
57
|
+
if (oldParams) {
|
|
58
|
+
newParams = mergeFunc(oldParams, newParams);
|
|
59
|
+
}
|
|
60
|
+
oldParams = newParams;
|
|
61
|
+
return debounceFunc(...newParams);
|
|
62
|
+
};
|
|
63
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/core",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.13",
|
|
4
4
|
"description": "核心包",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"types": "out/index.d.ts",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://gitee.com/iBizModeling/ibiz-template.git"
|
|
10
|
+
},
|
|
7
11
|
"files": [
|
|
8
12
|
"out",
|
|
9
13
|
"src"
|
|
@@ -11,23 +15,29 @@
|
|
|
11
15
|
"scripts": {
|
|
12
16
|
"dev": "tsc --watch",
|
|
13
17
|
"build": "npm run lint && npm run clean && tsc --build",
|
|
14
|
-
"lint": "eslint src/**/*.ts",
|
|
15
|
-
"lint:fix": "eslint --fix src/**/*.ts",
|
|
18
|
+
"lint": "eslint 'src/**/*.ts'",
|
|
19
|
+
"lint:fix": "eslint --fix 'src/**/*.ts'",
|
|
16
20
|
"clean": "rimraf out",
|
|
21
|
+
"test": "jest",
|
|
17
22
|
"publish:next": "npm run build && npm publish --access public --tag next",
|
|
18
23
|
"publish:npm": "npm run build && npm publish --access public"
|
|
19
24
|
},
|
|
20
25
|
"author": "chitanda",
|
|
21
26
|
"license": "MIT",
|
|
22
27
|
"dependencies": {
|
|
23
|
-
"@ibiz-template/command": "^0.0.1-alpha.1",
|
|
24
|
-
"@ibiz-template/model": "^0.0.1-alpha.1",
|
|
25
28
|
"axios": "^0.27.2",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
29
|
+
"pluralize": "^8.0.0",
|
|
30
|
+
"qs": "^6.11.0"
|
|
28
31
|
},
|
|
29
32
|
"devDependencies": {
|
|
30
|
-
"@types/
|
|
33
|
+
"@types/pluralize": "^0.0.29",
|
|
34
|
+
"@types/qs": "^6.9.7",
|
|
35
|
+
"lodash-es": "^4.17.21",
|
|
36
|
+
"qx-util": "^0.4.1"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"lodash-es": "^4.17.21",
|
|
40
|
+
"qx-util": "^0.4.1"
|
|
31
41
|
},
|
|
32
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "e72517e4226353804443c9a0cd7b40aaf0edf846"
|
|
33
43
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 请求状态码文本
|
|
3
|
+
*/
|
|
4
|
+
export const HttpStatusMessageConst: Record<number, string> = {
|
|
5
|
+
200: '服务器成功返回请求的数据。',
|
|
6
|
+
201: '新建或修改数据成功。',
|
|
7
|
+
202: '一个请求已经进入后台排队(异步任务)。',
|
|
8
|
+
204: '删除数据成功。',
|
|
9
|
+
400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。',
|
|
10
|
+
401: '用户没有权限(令牌、用户名、密码错误)。',
|
|
11
|
+
403: '用户得到授权,但是访问是被禁止的。',
|
|
12
|
+
404: '发出的请求针对的是不存在的记录,服务器没有进行操作。',
|
|
13
|
+
406: '请求的格式不可得。',
|
|
14
|
+
410: '请求的资源被永久删除,且不会再得到的。',
|
|
15
|
+
422: '当创建一个对象时,发生一个验证错误。',
|
|
16
|
+
500: '服务器发生错误,请检查服务器。',
|
|
17
|
+
502: '网关错误。',
|
|
18
|
+
503: '服务不可用,服务器暂时过载或维护。',
|
|
19
|
+
504: '网关超时。',
|
|
20
|
+
};
|
package/src/constant/index.ts
CHANGED
package/src/context/index.ts
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
/* eslint-disable no-constructor-return */
|
|
3
3
|
/* eslint-disable no-underscore-dangle */
|
|
4
4
|
/* eslint-disable max-classes-per-file */
|
|
5
|
+
|
|
6
|
+
import { clone } from 'lodash-es';
|
|
7
|
+
|
|
5
8
|
/**
|
|
6
9
|
* 上下文代理处理
|
|
7
10
|
*
|
|
@@ -17,14 +20,14 @@ export class IBizContextProxyHandle implements ProxyHandler<IBizContext> {
|
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
get(target: IBizContext, p: string | symbol, _receiver: unknown): unknown {
|
|
20
|
-
if (target[p]) {
|
|
23
|
+
if (target[p] !== undefined) {
|
|
21
24
|
return target[p];
|
|
22
25
|
}
|
|
23
|
-
if (target.context[p]) {
|
|
26
|
+
if (target.context[p] !== undefined) {
|
|
24
27
|
return target.context[p];
|
|
25
28
|
}
|
|
26
29
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
-
if ((target as any)._parent) {
|
|
30
|
+
if ((target as any)._parent && (target as any)._parent[p] !== undefined) {
|
|
28
31
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
32
|
return (target as any)._parent[p];
|
|
30
33
|
}
|
|
@@ -51,14 +54,14 @@ export class IBizContext implements IContext {
|
|
|
51
54
|
* @protected
|
|
52
55
|
* @type {(IBizContext | null)}
|
|
53
56
|
*/
|
|
54
|
-
protected _parent:
|
|
57
|
+
protected _parent: IContext | null = null;
|
|
55
58
|
|
|
56
59
|
/**
|
|
57
60
|
* Creates an instance of IBizContext.
|
|
58
61
|
*
|
|
59
62
|
* @author chitanda
|
|
60
63
|
* @date 2022-07-14 10:07:15
|
|
61
|
-
* @param {IContext} [context={}]
|
|
64
|
+
* @param {IContext} [context={}] 自身的上下文
|
|
62
65
|
* @param {IBizContext} [parent]
|
|
63
66
|
*/
|
|
64
67
|
constructor(public context: IContext = {}, parent?: IBizContext) {
|
|
@@ -80,6 +83,22 @@ export class IBizContext implements IContext {
|
|
|
80
83
|
return new Proxy(this, new IBizContextProxyHandle());
|
|
81
84
|
}
|
|
82
85
|
|
|
86
|
+
/**
|
|
87
|
+
* 获取所有上下文参数,无多层级默认合并
|
|
88
|
+
*
|
|
89
|
+
* @author chitanda
|
|
90
|
+
* @date 2022-09-28 14:09:20
|
|
91
|
+
* @return {*} {IContext}
|
|
92
|
+
*/
|
|
93
|
+
getContext(): IContext {
|
|
94
|
+
if (this.parent) {
|
|
95
|
+
const ctx = this.parent.getContext();
|
|
96
|
+
Object.assign(ctx, clone(this.context));
|
|
97
|
+
return ctx;
|
|
98
|
+
}
|
|
99
|
+
return clone(this.context);
|
|
100
|
+
}
|
|
101
|
+
|
|
83
102
|
/**
|
|
84
103
|
* 销毁上下文,避免内存泄漏
|
|
85
104
|
*
|
|
@@ -4,5 +4,10 @@ import { IEnvironment } from '../interface';
|
|
|
4
4
|
* 环境变量
|
|
5
5
|
*/
|
|
6
6
|
export const Environment: IEnvironment = {
|
|
7
|
-
baseUrl: '
|
|
7
|
+
baseUrl: '',
|
|
8
|
+
remoteModelUrl: '/remotemodel',
|
|
9
|
+
assetsUrl: './assets',
|
|
10
|
+
dcSystem: '',
|
|
11
|
+
ExportFile: '/ibizutil/download',
|
|
12
|
+
UploadFile: '/ibizutil/upload',
|
|
8
13
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AxiosError, AxiosResponse } from 'axios';
|
|
2
|
+
import { HttpStatusMessageConst } from '../../constant';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 请求异常
|
|
6
|
+
*
|
|
7
|
+
* @author chitanda
|
|
8
|
+
* @date 2022-09-18 17:09:10
|
|
9
|
+
* @export
|
|
10
|
+
* @class HttpError
|
|
11
|
+
* @implements {Error}
|
|
12
|
+
*/
|
|
13
|
+
export class HttpError implements Error {
|
|
14
|
+
name: string = 'HttpError';
|
|
15
|
+
|
|
16
|
+
message: string;
|
|
17
|
+
|
|
18
|
+
status: number;
|
|
19
|
+
|
|
20
|
+
response?: AxiosResponse;
|
|
21
|
+
|
|
22
|
+
constructor(err: AxiosError) {
|
|
23
|
+
const res = err.response;
|
|
24
|
+
this.response = err.response;
|
|
25
|
+
if (res) {
|
|
26
|
+
if (res.data) {
|
|
27
|
+
this.message = (res.data as IData).message;
|
|
28
|
+
} else {
|
|
29
|
+
this.message = res.statusText;
|
|
30
|
+
}
|
|
31
|
+
if (!this.message) {
|
|
32
|
+
this.message = HttpStatusMessageConst[res.status];
|
|
33
|
+
}
|
|
34
|
+
if (!this.message) {
|
|
35
|
+
this.message = '网络异常,请稍后重试!';
|
|
36
|
+
}
|
|
37
|
+
this.status = res.status;
|
|
38
|
+
} else {
|
|
39
|
+
this.message = err.message;
|
|
40
|
+
this.status = 500;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 运行时异常
|
|
3
|
+
*
|
|
4
|
+
* @author lxm
|
|
5
|
+
* @date 2022-09-21 18:09:09
|
|
6
|
+
* @export
|
|
7
|
+
* @class RuntimeError
|
|
8
|
+
* @implements {Error}
|
|
9
|
+
*/
|
|
10
|
+
export class RuntimeError implements Error {
|
|
11
|
+
name: string = 'Runtime Error';
|
|
12
|
+
|
|
13
|
+
constructor(public message: string) {}
|
|
14
|
+
}
|
package/src/ibizsys.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { commands } from '@ibiz-template/command';
|
|
2
1
|
import { Environment } from './environment/environment';
|
|
3
2
|
import { OrgData } from './interface';
|
|
4
3
|
import { Net } from './utils';
|
|
@@ -20,14 +19,6 @@ export class IBizSys {
|
|
|
20
19
|
*/
|
|
21
20
|
env = Environment;
|
|
22
21
|
|
|
23
|
-
/**
|
|
24
|
-
* 指令控制器
|
|
25
|
-
*
|
|
26
|
-
* @author chitanda
|
|
27
|
-
* @date 2022-07-21 17:07:45
|
|
28
|
-
*/
|
|
29
|
-
commands = commands;
|
|
30
|
-
|
|
31
22
|
/**
|
|
32
23
|
* 网络请求工具类
|
|
33
24
|
*
|
|
@@ -35,7 +26,7 @@ export class IBizSys {
|
|
|
35
26
|
* @date 2022-07-19 17:07:56
|
|
36
27
|
* @type {Net}
|
|
37
28
|
*/
|
|
38
|
-
net: Net = new Net(
|
|
29
|
+
net: Net = new Net();
|
|
39
30
|
|
|
40
31
|
/**
|
|
41
32
|
* sass 模式下的中心系统标识
|
package/src/index.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import './types';
|
|
2
2
|
|
|
3
|
-
export { commands } from '@ibiz-template/command';
|
|
4
|
-
|
|
5
3
|
export * from './constant';
|
|
6
4
|
export { IBizContext, IBizContextProxyHandle } from './context';
|
|
7
5
|
export { Environment } from './environment/environment';
|
|
6
|
+
export * from './error';
|
|
8
7
|
export * from './interface';
|
|
9
8
|
export * from './utils';
|
|
10
9
|
export { IBizSys } from './ibizsys';
|
package/src/install.ts
CHANGED
|
@@ -9,8 +9,9 @@ import { Interceptor } from './utils';
|
|
|
9
9
|
* @export
|
|
10
10
|
*/
|
|
11
11
|
export function install(): void {
|
|
12
|
-
if (
|
|
13
|
-
|
|
12
|
+
if (window.ibiz) {
|
|
13
|
+
throw new Error('ibiz 已经存在, 无需重复安装');
|
|
14
14
|
}
|
|
15
|
+
window.ibiz = new IBizSys();
|
|
15
16
|
new Interceptor();
|
|
16
17
|
}
|
|
@@ -7,8 +7,15 @@
|
|
|
7
7
|
* @interface IEnvironment
|
|
8
8
|
*/
|
|
9
9
|
export interface IEnvironment {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* 命名空间
|
|
12
|
+
*
|
|
13
|
+
* @author chitanda
|
|
14
|
+
* @date 2022-09-06 11:09:32
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
namespace?: string;
|
|
18
|
+
|
|
12
19
|
/**
|
|
13
20
|
* 请求根路径
|
|
14
21
|
*
|
|
@@ -17,4 +24,49 @@ export interface IEnvironment {
|
|
|
17
24
|
* @type {string}
|
|
18
25
|
*/
|
|
19
26
|
baseUrl: string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 远程模型路径
|
|
30
|
+
*
|
|
31
|
+
* @author chitanda
|
|
32
|
+
* @date 2022-09-22 18:09:25
|
|
33
|
+
* @type {string}
|
|
34
|
+
*/
|
|
35
|
+
remoteModelUrl: string;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 资源文件根路径
|
|
39
|
+
*
|
|
40
|
+
* @author lxm
|
|
41
|
+
* @date 2022-08-25 14:08:08
|
|
42
|
+
* @type {string}
|
|
43
|
+
*/
|
|
44
|
+
assetsUrl: string;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 中心系统标识
|
|
48
|
+
*
|
|
49
|
+
* @author chitanda
|
|
50
|
+
* @date 2022-08-22 23:08:46
|
|
51
|
+
* @type {string}
|
|
52
|
+
*/
|
|
53
|
+
dcSystem: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 文件导出
|
|
57
|
+
*
|
|
58
|
+
* @author chitanda
|
|
59
|
+
* @date 2022-08-22 23:08:46
|
|
60
|
+
* @type {string}
|
|
61
|
+
*/
|
|
62
|
+
ExportFile: string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 文件上传
|
|
66
|
+
*
|
|
67
|
+
* @author chitanda
|
|
68
|
+
* @date 2022-08-22 23:08:46
|
|
69
|
+
* @type {string}
|
|
70
|
+
*/
|
|
71
|
+
UploadFile: string;
|
|
20
72
|
}
|
package/src/types.ts
CHANGED
|
@@ -40,4 +40,15 @@ declare global {
|
|
|
40
40
|
interface IData {
|
|
41
41
|
[key: string | symbol]: any;
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 任意对象结构
|
|
46
|
+
*
|
|
47
|
+
* @author chitanda
|
|
48
|
+
* @date 2022-09-21 15:09:30
|
|
49
|
+
* @interface IObject
|
|
50
|
+
*/
|
|
51
|
+
interface IObject {
|
|
52
|
+
[key: string | symbol]: any;
|
|
53
|
+
}
|
|
43
54
|
}
|
package/src/utils/index.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export { Interceptor } from './interceptor/interceptor';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { Namespace } from './namespace/namespace';
|
|
3
|
+
export { IHttpResponse, HttpResponse } from './net/http-response';
|
|
4
|
+
export { Net } from './net/net';
|
|
5
|
+
export { plural, pluralLower } from './plural/plural';
|
|
6
|
+
export * from './util/util';
|