@das-fed/utils 6.3.0-beta.3 → 6.3.0-beta.8
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/__VLS_types.d.ts +124 -0
- package/api-services/modules/app-manage/index.d.ts +2 -0
- package/api-services/modules/app-manage/index.js +5 -0
- package/api-services/modules/authentication/index.d.ts +2 -0
- package/api-services/modules/authentication/index.js +5 -0
- package/api-services/modules/bems/index.d.ts +6 -0
- package/api-services/modules/bems/index.js +9 -0
- package/api-services/modules/contract/index.d.ts +2 -0
- package/api-services/modules/contract/index.js +5 -0
- package/api-services/modules/duty-manage/index.d.ts +7 -0
- package/api-services/modules/duty-manage/index.js +14 -0
- package/api-services/modules/enterpriseright/index.d.ts +2 -0
- package/api-services/modules/enterpriseright/index.js +5 -0
- package/api-services/modules/file/index.d.ts +36 -0
- package/api-services/modules/file/index.js +499 -0
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.d.ts +2 -0
- package/api-services/modules/gateway-edge/index.js +5 -0
- package/api-services/modules/index.d.ts +21 -0
- package/api-services/modules/index.js +59 -0
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/index.d.ts +15 -0
- package/api-services/modules/iot/index.js +18 -0
- package/api-services/modules/justauth/index.d.ts +3 -0
- package/api-services/modules/justauth/index.js +6 -0
- package/api-services/modules/knowledge/index.d.ts +2 -0
- package/api-services/modules/knowledge/index.js +5 -0
- package/api-services/modules/link/index.d.ts +2 -0
- package/api-services/modules/link/index.js +5 -0
- package/api-services/modules/permission/index.d.ts +2 -0
- package/api-services/modules/permission/index.js +5 -0
- package/api-services/modules/platformManage/index.d.ts +14 -0
- package/api-services/modules/platformManage/index.js +13 -0
- package/api-services/modules/portal/index.d.ts +2 -0
- package/api-services/modules/portal/index.js +5 -0
- package/api-services/modules/space-manage/index.d.ts +2 -0
- package/api-services/modules/space-manage/index.js +5 -0
- package/api-services/modules/super-admin/index.d.ts +8 -0
- package/api-services/modules/super-admin/index.js +8 -0
- package/api-services/modules/supplier/index.d.ts +6 -0
- package/api-services/modules/supplier/index.js +7 -0
- package/api-services/modules/supplychain-manage/index.d.ts +2 -0
- package/api-services/modules/supplychain-manage/index.js +5 -0
- package/api-services/modules/systemConfiguration/index.d.ts +2 -0
- package/api-services/modules/systemConfiguration/index.js +5 -0
- package/api-services/modules/tool/index.d.ts +2 -0
- package/api-services/modules/tool/index.js +5 -0
- package/api-services/src/create-service/index.d.ts +1 -0
- package/api-services/src/create-service/index.js +4 -0
- package/common-info/getIframeUrl/index.d.ts +9 -0
- package/common-info/getIframeUrl/index.js +10 -0
- package/common-info/getInfoFromUrl/index.d.ts +8 -0
- package/common-info/getInfoFromUrl/index.js +84 -0
- package/common-info/getInfoFromUrl/index.js.gz +0 -0
- package/common-info/set-personal-info/index.d.ts +5 -0
- package/common-info/set-personal-info/index.js +1664 -0
- package/common-info/set-personal-info/index.js.gz +0 -0
- package/common-info/type.d.ts +104 -0
- package/common-tools/arr-tools/index.d.ts +15 -0
- package/common-tools/arr-tools/index.js +8 -0
- package/common-tools/date-format/index.d.ts +7 -0
- package/common-tools/date-format/index.js +18 -0
- package/common-tools/get-url-params/index.d.ts +46 -0
- package/common-tools/get-url-params/index.js +60 -0
- package/common-tools/get-url-params/index.js.gz +0 -0
- package/common-tools/handle-data/index.d.ts +6 -0
- package/common-tools/handle-data/index.js +4 -0
- package/common-tools/nest-tree-format/index.d.ts +30 -0
- package/common-tools/nest-tree-format/index.js +24 -0
- package/common-tools/obj-tools/index.d.ts +7 -0
- package/common-tools/obj-tools/index.js +14 -0
- package/common-tools/platform-tools/index.d.ts +18 -0
- package/common-tools/platform-tools/index.js +14 -0
- package/common-tools/queue-promise/index.d.ts +6 -0
- package/common-tools/queue-promise/index.js +9 -0
- package/common-tools/setHtmlMinWH/index.d.ts +5 -0
- package/common-tools/setHtmlMinWH/index.js +11 -0
- package/common-tools/update-fav-icon/index.d.ts +11 -0
- package/common-tools/update-fav-icon/index.js +21 -0
- package/create-api-service/proxy-sso/index.d.ts +3 -0
- package/create-api-service/proxy-sso/index.js +21 -0
- package/create-api-service/sso/index.d.ts +23 -0
- package/create-api-service/sso/index.js +1946 -0
- package/create-api-service/sso/index.js.gz +0 -0
- package/curring-http/type.d.ts +89 -0
- package/esm-map.json +3 -3
- package/package.json +3 -3
- package/webSocket-service/type.d.ts +28 -0
|
Binary file
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, AxiosError } from 'axios';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/** 请求工具配置项 */
|
|
6
|
+
export type CurringConfig = AxiosRequestConfig & {
|
|
7
|
+
/** 请求实例 */
|
|
8
|
+
axiosInstance?: AxiosInstance
|
|
9
|
+
|
|
10
|
+
/** 请求方法 */
|
|
11
|
+
method?: Method
|
|
12
|
+
|
|
13
|
+
/** 请求的body数据 */
|
|
14
|
+
data?: any
|
|
15
|
+
|
|
16
|
+
/** 请求的query数据 */
|
|
17
|
+
params?: any
|
|
18
|
+
|
|
19
|
+
/** 接口地址前缀 */
|
|
20
|
+
urlPrefix?: string
|
|
21
|
+
|
|
22
|
+
/** 标记为公共接口,不需要鉴权,默认为false */
|
|
23
|
+
public?: boolean
|
|
24
|
+
|
|
25
|
+
/** 请求成功执行的回调 */
|
|
26
|
+
onSuccess?: (res: any, config: CurringConfig) => Promise<any>
|
|
27
|
+
|
|
28
|
+
/** 请求失败执行的回调 */
|
|
29
|
+
onError?: (error: any, config: CurringConfig) => Promise<any>
|
|
30
|
+
|
|
31
|
+
/** 自定义处理请求失败执行的回调 */
|
|
32
|
+
onCustomError?: (error: any, config: CurringConfig) => Promise<any>
|
|
33
|
+
|
|
34
|
+
/** 不管请求成功或失败都会执行的回调 */
|
|
35
|
+
finally?: (config: CurringConfig) => any
|
|
36
|
+
|
|
37
|
+
/** 每次请求之前都会执行的函数 */
|
|
38
|
+
beforeRun?: (config: CurringConfig) => Promise<CurringConfig>
|
|
39
|
+
|
|
40
|
+
/** 自定义错误信息 */
|
|
41
|
+
customErrorMessage?: (
|
|
42
|
+
/** 原始错误信息 */
|
|
43
|
+
message: string,
|
|
44
|
+
|
|
45
|
+
/** 原始错误对象 */
|
|
46
|
+
error: any,
|
|
47
|
+
) => string | null | undefined
|
|
48
|
+
|
|
49
|
+
/** 忽略错误提示 */
|
|
50
|
+
ignoreErrorMessage?: boolean
|
|
51
|
+
|
|
52
|
+
/** 接口401是否重定向到登录页 */
|
|
53
|
+
noRedireLogin?: boolean
|
|
54
|
+
|
|
55
|
+
/** 开启CSRF安全选项 */
|
|
56
|
+
csrf?: boolean
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type Method = 'get' | 'post' | 'put' | 'delete' | 'patch'
|
|
60
|
+
|
|
61
|
+
export type CurringConfigFun = (config: CurringConfig) => CurringConfig | Promise<CurringConfig>
|
|
62
|
+
|
|
63
|
+
export type CurringRes = {
|
|
64
|
+
/** 请求时返回的接口数据 */
|
|
65
|
+
data: Ref<any>
|
|
66
|
+
|
|
67
|
+
/** 请求时的错误信息 */
|
|
68
|
+
error: Ref<any>
|
|
69
|
+
|
|
70
|
+
/** 请求时的loading */
|
|
71
|
+
loading: Ref<boolean>
|
|
72
|
+
|
|
73
|
+
/** 发起请求 返回格式 [ error, data ] */
|
|
74
|
+
run: (payload?: any, config?: CurringConfig) => CurringRunRes
|
|
75
|
+
|
|
76
|
+
/** 取消请求控制器 */
|
|
77
|
+
abortController: Ref<AbortController | null>
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** 返回为数组 [error, data], 请求成功error为null,请求失败data为null */
|
|
81
|
+
export type CurringRunRes = Promise<
|
|
82
|
+
[
|
|
83
|
+
/** 请求返回的错误信息,请求成功时为null,请求失败时为错误信息 */
|
|
84
|
+
error: { code: string | number; msg: string; error: AxiosError } | null,
|
|
85
|
+
|
|
86
|
+
/** 请求返回的接口数据,请求成功时为后端数据,请求失败时为null */
|
|
87
|
+
data: any | null,
|
|
88
|
+
]
|
|
89
|
+
>
|
package/esm-map.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
+
"vHoverInside": "/directive/index",
|
|
2
3
|
"SFCWithInstall": "/with-install/index",
|
|
3
4
|
"withInstall": "/with-install/index",
|
|
4
|
-
"vClickOutside": "/directive/index",
|
|
5
5
|
"vAuth": "/directive/index",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
6
|
+
"getEl": "/directive/utils",
|
|
7
|
+
"vClickOutside": "/directive/clickOutside"
|
|
8
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@das-fed/utils",
|
|
3
|
-
"version": "6.3.0-beta.
|
|
3
|
+
"version": "6.3.0-beta.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"license": "ISC",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@antv/x6": "^2.18.1",
|
|
12
|
-
"@das-fed/utils": "6.3.0-beta.
|
|
12
|
+
"@das-fed/utils": "6.3.0-beta.8",
|
|
13
13
|
"@vue/shared": "^3.4.21",
|
|
14
14
|
"@vueuse/core": "^9.6.0",
|
|
15
15
|
"axios": "^1.6.7",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"vue": "^3.4.21"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@das-fed/cli": "6.3.0-beta.
|
|
24
|
+
"@das-fed/cli": "6.3.0-beta.8",
|
|
25
25
|
"@types/lodash-es": "^4.17.12",
|
|
26
26
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
27
27
|
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type socketConfig = {
|
|
2
|
+
/** 请求地址 */
|
|
3
|
+
url: string
|
|
4
|
+
|
|
5
|
+
/** 请求参数 */
|
|
6
|
+
params?: Record<string, any>
|
|
7
|
+
|
|
8
|
+
/** websocket连接成功回调 */
|
|
9
|
+
opened?: (event: any) => void
|
|
10
|
+
|
|
11
|
+
/** websocket关闭连接回调 */
|
|
12
|
+
close?: (event: any) => void
|
|
13
|
+
|
|
14
|
+
/** websocket接收到消息回调 */
|
|
15
|
+
message?: (event: any) => void
|
|
16
|
+
|
|
17
|
+
/** websocket连接异常回调 */
|
|
18
|
+
error?: (event: any) => void
|
|
19
|
+
|
|
20
|
+
/** 是否重连,默认开启 */
|
|
21
|
+
ifReconnect?: boolean
|
|
22
|
+
|
|
23
|
+
/** 连接close关闭时是否重连,默认关闭 */
|
|
24
|
+
reconnectWhenClose?: boolean
|
|
25
|
+
|
|
26
|
+
/** 重连次数,默认为3,-1 表示一直重连 */
|
|
27
|
+
reconnectNum?: number
|
|
28
|
+
}
|