@ibiz-template/core 0.0.1-beta.1 → 0.0.2-beta.0
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/system/index.system.js +1 -1
- package/out/command/command-register.d.ts +66 -0
- package/out/command/command-register.d.ts.map +1 -0
- package/out/command/command-register.js +113 -0
- package/out/command/command.d.ts +54 -0
- package/out/command/command.d.ts.map +1 -0
- package/out/command/command.js +71 -0
- package/out/command/index.d.ts +10 -0
- package/out/command/index.d.ts.map +1 -0
- package/out/command/index.js +9 -0
- package/out/command/interface/command/command-option.d.ts +23 -0
- package/out/command/interface/command/command-option.d.ts.map +1 -0
- package/out/command/interface/command/command-option.js +1 -0
- package/out/command/interface/command/command.d.ts +74 -0
- package/out/command/interface/command/command.d.ts.map +1 -0
- package/out/command/interface/command/command.js +1 -0
- package/out/command/interface/disposable/disposable.d.ts +4 -0
- package/out/command/interface/disposable/disposable.d.ts.map +1 -0
- package/out/command/interface/disposable/disposable.js +1 -0
- package/out/command/interface/index.d.ts +4 -0
- package/out/command/interface/index.d.ts.map +1 -0
- package/out/command/interface/index.js +1 -0
- package/out/command/utils/index.d.ts +3 -0
- package/out/command/utils/index.d.ts.map +1 -0
- package/out/command/utils/index.js +2 -0
- package/out/command/utils/linked-list.d.ts +16 -0
- package/out/command/utils/linked-list.d.ts.map +1 -0
- package/out/command/utils/linked-list.js +120 -0
- package/out/command/utils/util.d.ts +27 -0
- package/out/command/utils/util.d.ts.map +1 -0
- package/out/command/utils/util.js +77 -0
- package/out/context/index.d.ts +24 -0
- package/out/context/index.d.ts.map +1 -1
- package/out/context/index.js +24 -1
- package/out/environment/environment.d.ts.map +1 -1
- package/out/environment/environment.js +2 -1
- package/out/error/http-error/http-error.d.ts.map +1 -1
- package/out/error/http-error/http-error.js +0 -4
- package/out/ibizsys.d.ts +9 -0
- package/out/ibizsys.d.ts.map +1 -1
- package/out/ibizsys.js +9 -0
- package/out/index.d.ts +1 -0
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -0
- package/out/install.d.ts.map +1 -1
- package/out/install.js +0 -2
- package/out/interface/click-outside/click-outside.d.ts +1 -1
- package/out/interface/click-outside/click-outside.d.ts.map +1 -1
- package/out/interface/i-environment/i-environment.d.ts +15 -8
- package/out/interface/i-environment/i-environment.d.ts.map +1 -1
- package/out/utils/download-file/download-file.d.ts +10 -0
- package/out/utils/download-file/download-file.d.ts.map +1 -1
- package/out/utils/download-file/download-file.js +20 -0
- package/out/utils/index.d.ts +3 -0
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +3 -0
- package/out/utils/net/net.d.ts.map +1 -1
- package/out/utils/net/net.js +4 -1
- package/out/utils/sync/count-latch.d.ts +60 -0
- package/out/utils/sync/count-latch.d.ts.map +1 -0
- package/out/utils/sync/count-latch.js +93 -0
- package/out/utils/sync/index.d.ts +2 -0
- package/out/utils/sync/index.d.ts.map +1 -0
- package/out/utils/sync/index.js +1 -0
- package/out/utils/upload/select-file.d.ts +53 -0
- package/out/utils/upload/select-file.d.ts.map +1 -0
- package/out/utils/upload/select-file.js +47 -0
- package/out/utils/upload/upload-file.d.ts +46 -0
- package/out/utils/upload/upload-file.d.ts.map +1 -0
- package/out/utils/upload/upload-file.js +151 -0
- package/package.json +3 -3
- package/src/command/command-register.ts +135 -0
- package/src/command/command.ts +79 -0
- package/src/command/index.ts +11 -0
- package/src/command/interface/command/command-option.ts +22 -0
- package/src/command/interface/command/command.ts +86 -0
- package/src/command/interface/disposable/disposable.ts +3 -0
- package/src/command/interface/index.ts +9 -0
- package/src/command/utils/index.ts +2 -0
- package/src/command/utils/linked-list.ts +136 -0
- package/src/command/utils/util.ts +95 -0
- package/src/context/index.ts +45 -1
- package/src/environment/environment.ts +2 -1
- package/src/error/http-error/http-error.ts +0 -4
- package/src/ibizsys.ts +10 -0
- package/src/index.ts +1 -0
- package/src/install.ts +0 -2
- package/src/interface/i-environment/i-environment.ts +16 -8
- package/src/utils/download-file/download-file.ts +21 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/net/net.ts +5 -1
- package/src/utils/sync/count-latch.ts +99 -0
- package/src/utils/sync/index.ts +1 -0
- package/src/utils/upload/select-file.ts +86 -0
- package/src/utils/upload/upload-file.ts +207 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
2
|
+
/* eslint-disable no-underscore-dangle */
|
|
3
|
+
/* eslint-disable max-classes-per-file */
|
|
4
|
+
class Node {
|
|
5
|
+
constructor(element) {
|
|
6
|
+
this.element = element;
|
|
7
|
+
this.next = Node.Undefined;
|
|
8
|
+
this.prev = Node.Undefined;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
+
Node.Undefined = new Node(undefined);
|
|
13
|
+
export class LinkedList {
|
|
14
|
+
constructor() {
|
|
15
|
+
this._first = Node.Undefined;
|
|
16
|
+
this._last = Node.Undefined;
|
|
17
|
+
this._size = 0;
|
|
18
|
+
}
|
|
19
|
+
get size() {
|
|
20
|
+
return this._size;
|
|
21
|
+
}
|
|
22
|
+
isEmpty() {
|
|
23
|
+
return this._first === Node.Undefined;
|
|
24
|
+
}
|
|
25
|
+
clear() {
|
|
26
|
+
let node = this._first;
|
|
27
|
+
while (node !== Node.Undefined) {
|
|
28
|
+
const { next } = node;
|
|
29
|
+
node.prev = Node.Undefined;
|
|
30
|
+
node.next = Node.Undefined;
|
|
31
|
+
node = next;
|
|
32
|
+
}
|
|
33
|
+
this._first = Node.Undefined;
|
|
34
|
+
this._last = Node.Undefined;
|
|
35
|
+
this._size = 0;
|
|
36
|
+
}
|
|
37
|
+
unshift(element) {
|
|
38
|
+
return this._insert(element, false);
|
|
39
|
+
}
|
|
40
|
+
push(element) {
|
|
41
|
+
return this._insert(element, true);
|
|
42
|
+
}
|
|
43
|
+
_insert(element, atTheEnd) {
|
|
44
|
+
const newNode = new Node(element);
|
|
45
|
+
if (this._first === Node.Undefined) {
|
|
46
|
+
this._first = newNode;
|
|
47
|
+
this._last = newNode;
|
|
48
|
+
}
|
|
49
|
+
else if (atTheEnd) {
|
|
50
|
+
// push
|
|
51
|
+
const oldLast = this._last;
|
|
52
|
+
this._last = newNode;
|
|
53
|
+
newNode.prev = oldLast;
|
|
54
|
+
oldLast.next = newNode;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// unshift
|
|
58
|
+
const oldFirst = this._first;
|
|
59
|
+
this._first = newNode;
|
|
60
|
+
newNode.next = oldFirst;
|
|
61
|
+
oldFirst.prev = newNode;
|
|
62
|
+
}
|
|
63
|
+
this._size += 1;
|
|
64
|
+
let didRemove = false;
|
|
65
|
+
return () => {
|
|
66
|
+
if (!didRemove) {
|
|
67
|
+
didRemove = true;
|
|
68
|
+
this._remove(newNode);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
shift() {
|
|
73
|
+
if (this._first === Node.Undefined) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
const res = this._first.element;
|
|
77
|
+
this._remove(this._first);
|
|
78
|
+
return res;
|
|
79
|
+
}
|
|
80
|
+
pop() {
|
|
81
|
+
if (this._last === Node.Undefined) {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
const res = this._last.element;
|
|
85
|
+
this._remove(this._last);
|
|
86
|
+
return res;
|
|
87
|
+
}
|
|
88
|
+
_remove(node) {
|
|
89
|
+
if (node.prev !== Node.Undefined && node.next !== Node.Undefined) {
|
|
90
|
+
// middle
|
|
91
|
+
const anchor = node.prev;
|
|
92
|
+
anchor.next = node.next;
|
|
93
|
+
node.next.prev = anchor;
|
|
94
|
+
}
|
|
95
|
+
else if (node.prev === Node.Undefined && node.next === Node.Undefined) {
|
|
96
|
+
// only node
|
|
97
|
+
this._first = Node.Undefined;
|
|
98
|
+
this._last = Node.Undefined;
|
|
99
|
+
}
|
|
100
|
+
else if (node.next === Node.Undefined) {
|
|
101
|
+
// last
|
|
102
|
+
this._last = this._last.prev;
|
|
103
|
+
this._last.next = Node.Undefined;
|
|
104
|
+
}
|
|
105
|
+
else if (node.prev === Node.Undefined) {
|
|
106
|
+
// first
|
|
107
|
+
this._first = this._first.next;
|
|
108
|
+
this._first.prev = Node.Undefined;
|
|
109
|
+
}
|
|
110
|
+
// done
|
|
111
|
+
this._size -= 1;
|
|
112
|
+
}
|
|
113
|
+
*[Symbol.iterator]() {
|
|
114
|
+
let node = this._first;
|
|
115
|
+
while (node !== Node.Undefined) {
|
|
116
|
+
yield node.element;
|
|
117
|
+
node = node.next;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IDisposable } from '../interface';
|
|
2
|
+
export declare function once<T extends Function>(this: unknown, fn: T): T;
|
|
3
|
+
export declare function toDisposable(fn: () => void): IDisposable;
|
|
4
|
+
/**
|
|
5
|
+
* 函数防抖---“立即执行版本” 和 “非立即执行版本” 的组合版本
|
|
6
|
+
*
|
|
7
|
+
* @author chitanda
|
|
8
|
+
* @date 2022-06-29 19:06:15
|
|
9
|
+
* @export
|
|
10
|
+
* @param {((...args: unknown[]) => void | Promise<void>)} func 处理函数
|
|
11
|
+
* @param {number} wait 延迟执行时间(毫秒)
|
|
12
|
+
* @param {boolean} [immediate] 是否立即执行
|
|
13
|
+
* @return {*} {(...args: unknown[]) => void}
|
|
14
|
+
*/
|
|
15
|
+
export declare function debounce(func: (...args: unknown[]) => void | Promise<void>, wait: number, immediate?: boolean): (...args: unknown[]) => void;
|
|
16
|
+
/**
|
|
17
|
+
* 节流函数
|
|
18
|
+
*
|
|
19
|
+
* @author chitanda
|
|
20
|
+
* @date 2022-06-29 20:06:38
|
|
21
|
+
* @export
|
|
22
|
+
* @param {((...args: unknown[]) => void | Promise<void>)} fn
|
|
23
|
+
* @param {number} wait
|
|
24
|
+
* @return {*} {(...args: unknown[]) => void}
|
|
25
|
+
*/
|
|
26
|
+
export declare function throttle(fn: (...args: unknown[]) => void | Promise<void>, wait: number): (...args: unknown[]) => void;
|
|
27
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/command/utils/util.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,wBAAgB,IAAI,CAAC,CAAC,SAAS,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAgBhE;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,WAAW,CAOxD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAClD,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,OAAO,GAClB,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAqB9B;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CACtB,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAChD,IAAI,EAAE,MAAM,GACX,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAU9B"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
2
|
+
export function once(fn) {
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
4
|
+
const _this = this;
|
|
5
|
+
let didCall = false;
|
|
6
|
+
let result;
|
|
7
|
+
return function () {
|
|
8
|
+
if (didCall) {
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
didCall = true;
|
|
12
|
+
result = fn.apply(_this, arguments);
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function toDisposable(fn) {
|
|
17
|
+
const self = {
|
|
18
|
+
dispose: once(() => {
|
|
19
|
+
fn();
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
return self;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 函数防抖---“立即执行版本” 和 “非立即执行版本” 的组合版本
|
|
26
|
+
*
|
|
27
|
+
* @author chitanda
|
|
28
|
+
* @date 2022-06-29 19:06:15
|
|
29
|
+
* @export
|
|
30
|
+
* @param {((...args: unknown[]) => void | Promise<void>)} func 处理函数
|
|
31
|
+
* @param {number} wait 延迟执行时间(毫秒)
|
|
32
|
+
* @param {boolean} [immediate] 是否立即执行
|
|
33
|
+
* @return {*} {(...args: unknown[]) => void}
|
|
34
|
+
*/
|
|
35
|
+
export function debounce(func, wait, immediate) {
|
|
36
|
+
let timer;
|
|
37
|
+
return function (...args) {
|
|
38
|
+
if (timer) {
|
|
39
|
+
clearTimeout(timer);
|
|
40
|
+
}
|
|
41
|
+
if (immediate) {
|
|
42
|
+
const callNow = !timer;
|
|
43
|
+
timer = setTimeout(() => {
|
|
44
|
+
timer = null;
|
|
45
|
+
}, wait);
|
|
46
|
+
if (callNow) {
|
|
47
|
+
func.apply(this, args);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
timer = setTimeout(() => {
|
|
52
|
+
func.apply(this, args);
|
|
53
|
+
}, wait);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 节流函数
|
|
59
|
+
*
|
|
60
|
+
* @author chitanda
|
|
61
|
+
* @date 2022-06-29 20:06:38
|
|
62
|
+
* @export
|
|
63
|
+
* @param {((...args: unknown[]) => void | Promise<void>)} fn
|
|
64
|
+
* @param {number} wait
|
|
65
|
+
* @return {*} {(...args: unknown[]) => void}
|
|
66
|
+
*/
|
|
67
|
+
export function throttle(fn, wait) {
|
|
68
|
+
let timer = null;
|
|
69
|
+
return function (...args) {
|
|
70
|
+
if (!timer) {
|
|
71
|
+
timer = setTimeout(() => {
|
|
72
|
+
fn.apply(this, args);
|
|
73
|
+
timer = null;
|
|
74
|
+
}, wait);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
package/out/context/index.d.ts
CHANGED
|
@@ -8,7 +8,23 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export declare class IBizContext implements IContext {
|
|
10
10
|
[key: string | symbol]: any;
|
|
11
|
+
/**
|
|
12
|
+
* 修改的父上下文
|
|
13
|
+
*
|
|
14
|
+
* @author lxm
|
|
15
|
+
* @date 2022-12-08 18:12:16
|
|
16
|
+
* @protected
|
|
17
|
+
* @type {IContext}
|
|
18
|
+
*/
|
|
11
19
|
protected _context: IContext;
|
|
20
|
+
/**
|
|
21
|
+
* 父的上下文源对象
|
|
22
|
+
*
|
|
23
|
+
* @author lxm
|
|
24
|
+
* @date 2022-12-08 18:12:31
|
|
25
|
+
* @type {IBizContext}
|
|
26
|
+
*/
|
|
27
|
+
_parent?: IBizContext;
|
|
12
28
|
/**
|
|
13
29
|
* Creates an instance of IBizContext.
|
|
14
30
|
*
|
|
@@ -18,5 +34,13 @@ export declare class IBizContext implements IContext {
|
|
|
18
34
|
* @param {IBizContext} [parent]
|
|
19
35
|
*/
|
|
20
36
|
constructor(context?: IContext, parent?: IBizContext);
|
|
37
|
+
/**
|
|
38
|
+
* 返回自身的上下文,独有的和与父有差异的。
|
|
39
|
+
*
|
|
40
|
+
* @author lxm
|
|
41
|
+
* @date 2022-12-08 17:12:26
|
|
42
|
+
* @returns {*} {IContext}
|
|
43
|
+
*/
|
|
44
|
+
getOwnContext(): IContext;
|
|
21
45
|
}
|
|
22
46
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,WAAY,YAAW,QAAQ;IAE1C,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE5B,SAAS,CAAC,QAAQ,EAAG,QAAQ,CAAC;IAE9B;;;;;;;OAOG;gBAES,OAAO,GAAE,QAAa,EAAE,MAAM,CAAC,EAAE,WAAW;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,WAAY,YAAW,QAAQ;IAE1C,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE5B;;;;;;;OAOG;IACH,SAAS,CAAC,QAAQ,EAAG,QAAQ,CAAC;IAE9B;;;;;;OAMG;IACK,OAAO,CAAC,EAAE,WAAW,CAAC;IAE9B;;;;;;;OAOG;gBAES,OAAO,GAAE,QAAa,EAAE,MAAM,CAAC,EAAE,WAAW;IA0CxD;;;;;;OAMG;IACH,aAAa,IAAI,QAAQ;CAa1B"}
|
package/out/context/index.js
CHANGED
|
@@ -20,7 +20,12 @@ export class IBizContext {
|
|
|
20
20
|
if (parent) {
|
|
21
21
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
22
22
|
const self = this;
|
|
23
|
-
//
|
|
23
|
+
// 定义私有变量,存放父上下文源对象
|
|
24
|
+
Object.defineProperty(this, '_parent', {
|
|
25
|
+
enumerable: false,
|
|
26
|
+
value: parent,
|
|
27
|
+
});
|
|
28
|
+
// 定义私有变量,用于存储对父已有上下文的修改。
|
|
24
29
|
Object.defineProperty(this, '_context', {
|
|
25
30
|
enumerable: false,
|
|
26
31
|
value: {},
|
|
@@ -52,4 +57,22 @@ export class IBizContext {
|
|
|
52
57
|
// 合并给入上下文
|
|
53
58
|
Object.assign(this, context);
|
|
54
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* 返回自身的上下文,独有的和与父有差异的。
|
|
62
|
+
*
|
|
63
|
+
* @author lxm
|
|
64
|
+
* @date 2022-12-08 17:12:26
|
|
65
|
+
* @returns {*} {IContext}
|
|
66
|
+
*/
|
|
67
|
+
getOwnContext() {
|
|
68
|
+
const result = {};
|
|
69
|
+
Object.keys(this).forEach(key => {
|
|
70
|
+
// 父没有的,或者修改了父的上下文
|
|
71
|
+
if (!Object.prototype.hasOwnProperty.call(this._parent, key) ||
|
|
72
|
+
Object.prototype.hasOwnProperty.call(this._context, key)) {
|
|
73
|
+
result[key] = this[key];
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
55
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/environment/environment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/environment/environment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,YAgBzB,CAAC"}
|
|
@@ -4,9 +4,10 @@ import { LoginMode, MenuPermissionMode } from '../constant';
|
|
|
4
4
|
*/
|
|
5
5
|
export const Environment = {
|
|
6
6
|
dev: false,
|
|
7
|
+
hub: false,
|
|
7
8
|
logLevel: 'ERROR',
|
|
8
|
-
jsCdn: 'https://cdn.jsdelivr.net',
|
|
9
9
|
baseUrl: '',
|
|
10
|
+
appId: '',
|
|
10
11
|
pluginBaseUrl: './plugins',
|
|
11
12
|
remoteModelUrl: '/remotemodel',
|
|
12
13
|
assetsUrl: './assets',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-error.d.ts","sourceRoot":"","sources":["../../../src/error/http-error/http-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"http-error.d.ts","sourceRoot":"","sources":["../../../src/error/http-error/http-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAElD;;;;;;;;GAQG;AACH,qBAAa,SAAU,YAAW,KAAK;IACrC,IAAI,EAAE,MAAM,CAAe;IAE3B,OAAO,EAAE,MAAM,CAAC;IAEhB,MAAM,EAAE,MAAM,CAAC;IAEf,QAAQ,CAAC,EAAE,aAAa,CAAC;gBAEb,GAAG,EAAE,UAAU;CAkB5B"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { HttpStatusMessageConst } from '../../constant';
|
|
2
1
|
/**
|
|
3
2
|
* 请求异常
|
|
4
3
|
*
|
|
@@ -20,9 +19,6 @@ export class HttpError {
|
|
|
20
19
|
else {
|
|
21
20
|
this.message = res.statusText;
|
|
22
21
|
}
|
|
23
|
-
if (!this.message) {
|
|
24
|
-
this.message = HttpStatusMessageConst[res.status];
|
|
25
|
-
}
|
|
26
22
|
if (!this.message) {
|
|
27
23
|
this.message = '网络异常,请稍后重试!';
|
|
28
24
|
}
|
package/out/ibizsys.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CommandController } from './command';
|
|
1
2
|
import { OrgData } from './interface';
|
|
2
3
|
import { Logger, Net } from './utils';
|
|
3
4
|
/**
|
|
@@ -31,6 +32,14 @@ export declare class IBizSys {
|
|
|
31
32
|
* @type {Net}
|
|
32
33
|
*/
|
|
33
34
|
net: Net;
|
|
35
|
+
/**
|
|
36
|
+
* 指令集
|
|
37
|
+
*
|
|
38
|
+
* @author chitanda
|
|
39
|
+
* @date 2022-07-20 10:07:33
|
|
40
|
+
* @type {AuthService}
|
|
41
|
+
*/
|
|
42
|
+
commands: CommandController;
|
|
34
43
|
/**
|
|
35
44
|
* sass 模式下的中心系统标识
|
|
36
45
|
*
|
package/out/ibizsys.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ibizsys.d.ts","sourceRoot":"","sources":["../src/ibizsys.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ibizsys.d.ts","sourceRoot":"","sources":["../src/ibizsys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;;;GAOG;AACH,qBAAa,OAAO;IAClB;;;;;OAKG;IACH,GAAG,qCAAe;IAElB;;;;;OAKG;IACH,GAAG,oBAAU;IAEb;;;;;;OAMG;IACH,GAAG,EAAE,GAAG,CAAa;IAErB;;;;;;OAMG;IACH,QAAQ,EAAE,iBAAiB,CAA2B;IAEtD;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB"}
|
package/out/ibizsys.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CommandController } from './command';
|
|
1
2
|
import { Environment } from './environment/environment';
|
|
2
3
|
import { Logger, Net } from './utils';
|
|
3
4
|
/**
|
|
@@ -32,5 +33,13 @@ export class IBizSys {
|
|
|
32
33
|
* @type {Net}
|
|
33
34
|
*/
|
|
34
35
|
this.net = new Net();
|
|
36
|
+
/**
|
|
37
|
+
* 指令集
|
|
38
|
+
*
|
|
39
|
+
* @author chitanda
|
|
40
|
+
* @date 2022-07-20 10:07:33
|
|
41
|
+
* @type {AuthService}
|
|
42
|
+
*/
|
|
43
|
+
this.commands = new CommandController();
|
|
35
44
|
}
|
|
36
45
|
}
|
package/out/index.d.ts
CHANGED
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAC;AAEjB,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAC;AAEjB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
package/out/index.js
CHANGED
package/out/install.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAM9B"}
|
package/out/install.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FactoryCenter } from './factory-center';
|
|
2
2
|
import { IBizSys } from './ibizsys';
|
|
3
|
-
import { CoreInterceptor } from './utils';
|
|
4
3
|
/**
|
|
5
4
|
* 初始化全局对象
|
|
6
5
|
*
|
|
@@ -14,5 +13,4 @@ export function install() {
|
|
|
14
13
|
}
|
|
15
14
|
window.ibiz = new IBizSys();
|
|
16
15
|
window.___fc = new FactoryCenter();
|
|
17
|
-
ibiz.net.addInterceptor('CoreInterceptor', new CoreInterceptor());
|
|
18
16
|
}
|
|
@@ -35,7 +35,7 @@ export interface OnClickOutsideOptions {
|
|
|
35
35
|
/**
|
|
36
36
|
* 回调处理函数类型
|
|
37
37
|
*/
|
|
38
|
-
export
|
|
38
|
+
export type OnClickOutsideHandler = (_evt: PointerEvent | MouseEvent) => void;
|
|
39
39
|
/**
|
|
40
40
|
* OnClickOutside返回对象类型
|
|
41
41
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"click-outside.d.ts","sourceRoot":"","sources":["../../../src/interface/click-outside/click-outside.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"click-outside.d.ts","sourceRoot":"","sources":["../../../src/interface/click-outside/click-outside.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,KAAK,IAAI,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB;;;;;OAKG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB;;;;;OAKG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB"}
|
|
@@ -27,22 +27,29 @@ export interface IEnvironment {
|
|
|
27
27
|
*/
|
|
28
28
|
dev: boolean;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* 是否为多应用 hub 基座模式
|
|
31
31
|
*
|
|
32
32
|
* @author chitanda
|
|
33
|
-
* @date 2022-
|
|
34
|
-
* @type {
|
|
33
|
+
* @date 2022-12-20 10:12:45
|
|
34
|
+
* @type {boolean}
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
hub: boolean;
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* 默认应用的应用标识
|
|
39
39
|
*
|
|
40
|
-
* @default https://cdn.jsdelivr.net/
|
|
41
40
|
* @author chitanda
|
|
42
|
-
* @date 2022-
|
|
41
|
+
* @date 2022-12-22 15:12:35
|
|
43
42
|
* @type {string}
|
|
44
43
|
*/
|
|
45
|
-
|
|
44
|
+
appId: string;
|
|
45
|
+
/**
|
|
46
|
+
* 日志级别
|
|
47
|
+
*
|
|
48
|
+
* @author chitanda
|
|
49
|
+
* @date 2022-10-25 20:10:55
|
|
50
|
+
* @type {LogLevelDesc}
|
|
51
|
+
*/
|
|
52
|
+
logLevel: LogLevelDesc;
|
|
46
53
|
/**
|
|
47
54
|
* 请求根路径
|
|
48
55
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i-environment.d.ts","sourceRoot":"","sources":["../../../src/interface/i-environment/i-environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,GAAG,EAAE,OAAO,CAAC;IAEb;;;;;;OAMG;IACH,
|
|
1
|
+
{"version":3,"file":"i-environment.d.ts","sourceRoot":"","sources":["../../../src/interface/i-environment/i-environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,GAAG,EAAE,OAAO,CAAC;IAEb;;;;;;OAMG;IACH,GAAG,EAAE,OAAO,CAAC;IAEb;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,QAAQ,EAAE,YAAY,CAAC;IAEvB;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;OAMG;IACH,SAAS,EAAE,SAAS,CAAC;IAErB;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;OAMG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;;;;;OAMG;IACH,kBAAkB,EAAE,kBAAkB,CAAC;CACxC"}
|
|
@@ -8,6 +8,16 @@
|
|
|
8
8
|
* @returns {*}
|
|
9
9
|
*/
|
|
10
10
|
export declare function calcMimeByFileName(fileName: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* 判断是否是图片格式
|
|
13
|
+
*
|
|
14
|
+
* @author lxm
|
|
15
|
+
* @date 2022-11-21 13:11:23
|
|
16
|
+
* @export
|
|
17
|
+
* @param {string} fileName
|
|
18
|
+
* @returns {*} {boolean}
|
|
19
|
+
*/
|
|
20
|
+
export declare function isImage(fileName: string): boolean;
|
|
11
21
|
/**
|
|
12
22
|
* 纯JS触发下载文件
|
|
13
23
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download-file.d.ts","sourceRoot":"","sources":["../../../src/utils/download-file/download-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"download-file.d.ts","sourceRoot":"","sources":["../../../src/utils/download-file/download-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,UAmDlD;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAOjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAmBhE"}
|
|
@@ -51,11 +51,31 @@ export function calcMimeByFileName(fileName) {
|
|
|
51
51
|
case '.tar':
|
|
52
52
|
mime = 'application/x-tar';
|
|
53
53
|
break;
|
|
54
|
+
case '.xlsx':
|
|
55
|
+
mime = 'application/vnd.ms-excel';
|
|
56
|
+
break;
|
|
54
57
|
default:
|
|
55
58
|
mime = '';
|
|
56
59
|
}
|
|
57
60
|
return mime;
|
|
58
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* 判断是否是图片格式
|
|
64
|
+
*
|
|
65
|
+
* @author lxm
|
|
66
|
+
* @date 2022-11-21 13:11:23
|
|
67
|
+
* @export
|
|
68
|
+
* @param {string} fileName
|
|
69
|
+
* @returns {*} {boolean}
|
|
70
|
+
*/
|
|
71
|
+
export function isImage(fileName) {
|
|
72
|
+
const ext = fileName.split('.').pop();
|
|
73
|
+
if (!ext) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
const imageTypes = ['.jpeg', 'jpg', 'gif', 'png', 'bmp', 'svg'];
|
|
77
|
+
return imageTypes.includes(ext);
|
|
78
|
+
}
|
|
59
79
|
/**
|
|
60
80
|
* 纯JS触发下载文件
|
|
61
81
|
*
|
package/out/utils/index.d.ts
CHANGED
|
@@ -10,4 +10,7 @@ export * from './event/event';
|
|
|
10
10
|
export * from './click-outside/click-outside';
|
|
11
11
|
export * from './color/color';
|
|
12
12
|
export * from './download-file/download-file';
|
|
13
|
+
export * from './upload/select-file';
|
|
14
|
+
export * from './upload/upload-file';
|
|
15
|
+
export * from './sync';
|
|
13
16
|
//# sourceMappingURL=index.d.ts.map
|
package/out/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtD,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtD,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,QAAQ,CAAC"}
|
package/out/utils/index.js
CHANGED
|
@@ -10,3 +10,6 @@ export * from './event/event';
|
|
|
10
10
|
export * from './click-outside/click-outside';
|
|
11
11
|
export * from './color/color';
|
|
12
12
|
export * from './download-file/download-file';
|
|
13
|
+
export * from './upload/select-file';
|
|
14
|
+
export * from './upload/upload-file';
|
|
15
|
+
export * from './sync';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"net.d.ts","sourceRoot":"","sources":["../../../src/utils/net/net.ts"],"names":[],"mappings":"AAAA,OAAc,EAEZ,sBAAsB,EAEtB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACpB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"net.d.ts","sourceRoot":"","sources":["../../../src/utils/net/net.ts"],"names":[],"mappings":"AAAA,OAAc,EAEZ,sBAAsB,EAEtB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACpB,MAAM,OAAO,CAAC;AAMf,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;GAOG;AACH,qBAAa,GAAG;IACd;;;;;;;OAOG;IACH,SAAS,CAAC,QAAQ,EAAE,aAAa,CAAC;IAElC;;;;;OAKG;gBACS,MAAM,CAAC,EAAE,mBAAmB;IAKxC;;;;;;OAMG;IACH,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAa;IAEnD;;;;;;;OAOG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW;IAKrD;;;;;;OAMG;IACH,iBAAiB,CAAC,IAAI,EAAE,MAAM;IAQ9B;;;;;;;;OAQG;IACH,SAAS,KAAK,YAAY,IAAI,kBAAkB,CAW/C;IAED;;;;;;;;OAQG;IACH,SAAS,CAAC,WAAW,CAAC,GAAG,OAAO,EAAE,kBAAkB,EAAE;IAOtD;;;;;;;;;;OAUG;IACG,IAAI,CACR,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,KAAK,EACX,MAAM,GAAE,OAAY,EACpB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,aAAa,CAAC;IAczB;;;;;;;;;;OAUG;IACG,GAAG,CACP,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,OAAY,EACpB,OAAO,GAAE,sBAA2B,EACpC,MAAM,GAAE,kBAAuB,GAC9B,OAAO,CAAC,aAAa,CAAC;IAiBzB;;;;;;;;;OASG;IACG,MAAM,CACV,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,OAAO,EAChB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,aAAa,CAAC;IAUzB;;;;;;;;;;OAUG;IACG,GAAG,CACP,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,KAAK,EACX,MAAM,GAAE,OAAY,EACpB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,aAAa,CAAC;IAczB;;;;;;;;OAQG;IACG,QAAQ,CACZ,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,aAAa,CAAC;IAWzB;;;;;;;;OAQG;IACG,OAAO,CACX,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,kBAAuB,GAC9B,OAAO,CAAC,aAAa,CAAC;IAWzB;;;;;;;;OAQG;IACH,OAAO,CAAC,gBAAgB;IAQxB;;;;;;;;;OASG;IACH,OAAO,CAAC,oBAAoB;IAc5B;;;;;;;;;OASG;IACH,OAAO,CAAC,cAAc;CAevB"}
|
package/out/utils/net/net.js
CHANGED
|
@@ -3,6 +3,7 @@ import { merge } from 'lodash-es';
|
|
|
3
3
|
import { stringify } from 'qs';
|
|
4
4
|
import { notNilEmpty } from 'qx-util';
|
|
5
5
|
import { HttpError } from '../../error';
|
|
6
|
+
import { CoreInterceptor } from '../interceptor';
|
|
6
7
|
/**
|
|
7
8
|
* 全局请求工具类
|
|
8
9
|
*
|
|
@@ -28,6 +29,7 @@ export class Net {
|
|
|
28
29
|
*/
|
|
29
30
|
this.interceptors = new Map();
|
|
30
31
|
this.instance = axios.create(config);
|
|
32
|
+
this.addInterceptor('Default', new CoreInterceptor());
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* 添加拦截器
|
|
@@ -67,7 +69,8 @@ export class Net {
|
|
|
67
69
|
get presetConfig() {
|
|
68
70
|
return {
|
|
69
71
|
// 请求前缀路径
|
|
70
|
-
baseURL: this.instance.defaults.baseURL ||
|
|
72
|
+
baseURL: this.instance.defaults.baseURL ||
|
|
73
|
+
`${ibiz.env.baseUrl}/${ibiz.env.appId}`,
|
|
71
74
|
headers: {
|
|
72
75
|
'Content-Type': 'application/json;charset=UTF-8',
|
|
73
76
|
Accept: 'application/json',
|