@das-fed/utils 6.4.0-dev.57 → 6.4.0-dev.59

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.
Files changed (46) hide show
  1. package/api-services/i18n/index.js.gz +0 -0
  2. package/api-services/index.js.gz +0 -0
  3. package/api-services/modules/app-manage/index.js.gz +0 -0
  4. package/api-services/modules/authentication/index.js.gz +0 -0
  5. package/api-services/modules/bems/index.js.gz +0 -0
  6. package/api-services/modules/contract/index.js.gz +0 -0
  7. package/api-services/modules/duty-manage/index.js.gz +0 -0
  8. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  9. package/api-services/modules/file/index.js.gz +0 -0
  10. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  11. package/api-services/modules/index.js.gz +0 -0
  12. package/api-services/modules/iot/index.js.gz +0 -0
  13. package/api-services/modules/justauth/index.js.gz +0 -0
  14. package/api-services/modules/knowledge/index.js.gz +0 -0
  15. package/api-services/modules/link/index.js.gz +0 -0
  16. package/api-services/modules/permission/index.js.gz +0 -0
  17. package/api-services/modules/platformManage/index.js.gz +0 -0
  18. package/api-services/modules/portal/index.js.gz +0 -0
  19. package/api-services/modules/space-manage/index.js.gz +0 -0
  20. package/api-services/modules/super-admin/index.js.gz +0 -0
  21. package/api-services/modules/supplier/index.js.gz +0 -0
  22. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  23. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  24. package/api-services/modules/tool/index.js.gz +0 -0
  25. package/api-services/src/create-service/index.js.gz +0 -0
  26. package/common-info/getInfoFromUrl/index.js.gz +0 -0
  27. package/common-info/index.js.gz +0 -0
  28. package/common-info/set-personal-info/index.js.gz +0 -0
  29. package/common-info/type.d.ts +175 -175
  30. package/common-tools/extract-file-name/index.js.gz +0 -0
  31. package/common-tools/get-url-params/index.js.gz +0 -0
  32. package/create-api-service/index.js.gz +0 -0
  33. package/create-api-service/sso/index.js.gz +0 -0
  34. package/curring-http/index.js.gz +0 -0
  35. package/curring-http/type.d.ts +87 -87
  36. package/directive/auth/index.js.gz +0 -0
  37. package/hooks/use-get-auth/index.js.gz +0 -0
  38. package/nextTiken/index.js.gz +0 -0
  39. package/package.json +4 -4
  40. package/pinyin-first-character/index.js.gz +0 -0
  41. package/style/index.js.gz +0 -0
  42. package/use-low-code/index.js +3 -3
  43. package/use-low-code/index.js.gz +0 -0
  44. package/use-low-code/style.css +1 -1
  45. package/webSocket-service/index.js.gz +0 -0
  46. package/webSocket-service/type.d.ts +28 -28
Binary file
Binary file
Binary file
Binary file
@@ -1,175 +1,175 @@
1
- export interface UserInfo {
2
- /** 用户id */
3
- id: string
4
- /** 用户名称 */
5
- name: string
6
- /** 用户标识 2 - B端身份, 4 - C 端身份, 6 - B+C 端身份 */
7
- flag: number
8
- /** 租户id */
9
- tenantId: string
10
- }
11
-
12
- export interface PersonalInfo {
13
- /** id */
14
- id: string
15
- /** 名称 */
16
- name: string
17
- /** 手机号 */
18
- phone: string
19
- /** 用户名称 */
20
- userName: string
21
- /** 邮箱 */
22
- email: string
23
- /** 头像 */
24
- headPicture: string
25
- }
26
-
27
- export interface TenantInfo {
28
- /** 用户ID */
29
- userId: string
30
- /** 用户名 */
31
- userName: string
32
- name: string
33
- /** 租户信息 */
34
- tenant: {
35
- id: string
36
- name: string
37
- adminUserId: string
38
- description: string
39
- domain: string
40
- }
41
- /** 用户标识 2 - B端身份, 4 - C 端身份, 6 - B+C 端身份 */
42
- flag: number
43
- areaCode: string
44
- /** 手机号 */
45
- phone: string
46
- }
47
-
48
- export interface HomeInfo {
49
- /** 应用code */
50
- applicationCode: string
51
- /** 应用path */
52
- applicationPath: string
53
- /** 是否启用 */
54
- enable: boolean
55
- originalCode: string
56
- routeUrl: string
57
- type: number | null
58
- }
59
-
60
- export interface PersonalConfigInfo {
61
- /** 侧边栏菜单风格(1:弹出式;2:内嵌式 )*/
62
- style: 1 | 2
63
- /** 皮肤风格 (default:默认皮肤;kjl:科技蓝;cjb:纯净白;ssl:深邃蓝)*/
64
- skinStyle: 'default' | 'kjl' | 'cjb' | 'ssl'
65
- }
66
-
67
- export interface ProjectInfo {
68
- /** 项目id */
69
- id: string
70
- /** 项目编码 */
71
- code: string
72
- /** 项目名称 */
73
- name: string
74
- /** 项目类型: 1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
75
- type: string
76
- /** 父级id */
77
- parentId?: string
78
- /** 父级名称 */
79
- parentName?: string
80
- /** 父级项目类型:1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
81
- parentType?: number
82
- /** 租户id */
83
- tenantId?: string
84
- /** 是否父级节点 */
85
- isParent?: boolean
86
- /** 是否叶子节点 */
87
- leaf?: boolean
88
- /** 是否可用 */
89
- optional?: boolean
90
- }
91
-
92
- export interface ProjectMessage {
93
- /** 主键id */
94
- id: number | string
95
- /** 项目名称 */
96
- projectName: string
97
- /** 省级(省份、直辖市、自治区)编码 */
98
- provinceCode: string
99
- /** 地级(城市)编码 */
100
- cityCode: string
101
- /** 县级(区县)编码 */
102
- areaCode: string
103
- /** 详细位置 */
104
- address: string
105
- /** 项目简介 */
106
- projectDesc: string
107
- /** 项目图片路径 */
108
- logoPath: string
109
- /** 项目类型 */
110
- projectType: string
111
- /** 项目类型code */
112
- projectTypeCode: string
113
- /** 经度 */
114
- longitude: string
115
- /** 纬度 */
116
- latitude: string
117
- /** 项目开始时间 */
118
- projectStartDate: string
119
- /** 项目有效期 */
120
- projectExpiryDate: string
121
- /** 项目编码 */
122
- projectCode: string
123
- /** 地图配置是否开启 */
124
- mapConfiguration: boolean
125
- /** 地级(城市)名称 */
126
- cityName: string
127
- /** 地级(城市)名称拼音 */
128
- cityNamePinyin: string
129
- /** 时区ID */
130
- timezone: string
131
- /** 是否自动设定时区 */
132
- autoTimezone: boolean
133
- /** 货币信息(currencyCode:ISO 4217货币编码(例:CNY);currencyUnit:货币单位,例:元(中文),CNY(英文);currencySymbol:货币符号,例:¥) */
134
- currency: Record<'currencyCode' | 'currencyUnit' | 'currencySymbol', string>
135
- }
136
-
137
- export interface SubAppsInfo {
138
- /** 所有应用信息 */
139
- appcategorys?: any[]
140
- /** 当前应用完整信息 */
141
- currentSubApp?: any
142
- /** 所有应用 */
143
- flatSubAppList?: any[]
144
- /** 当前应用code */
145
- currentSubAppCode?: string
146
- /** 当前打开的应用 */
147
- subAppList?: any[]
148
- /** 当前菜单折叠的应用key集合 */
149
- menuCollapses?: any[]
150
- }
151
-
152
- interface TabItem {
153
- /** 当前应用url */
154
- currentApplication: string
155
- /** 当前加载的应用 */
156
- applicationPath: string
157
- applicationCode: string
158
- menuId: string
159
- name: string
160
- path: string
161
- code: string
162
- query?: any
163
- }
164
- export interface TabInfo {
165
- /** 当前tabs key */
166
- currentCode?: string
167
- /** 当前tabs */
168
- currentTab?: TabItem
169
- /** 用于记录该应用上次开启的tab */
170
- preTab?: Record<string, TabItem>
171
- /** 当前打开的tabs(微前端环境会存入) */
172
- tabMap?: Record<string, TabItem[]>
173
- }
174
-
175
- export type permissionBtnInfo = { code?: string; name?: string }[]
1
+ export interface UserInfo {
2
+ /** 用户id */
3
+ id: string
4
+ /** 用户名称 */
5
+ name: string
6
+ /** 用户标识 2 - B端身份, 4 - C 端身份, 6 - B+C 端身份 */
7
+ flag: number
8
+ /** 租户id */
9
+ tenantId: string
10
+ }
11
+
12
+ export interface PersonalInfo {
13
+ /** id */
14
+ id: string
15
+ /** 名称 */
16
+ name: string
17
+ /** 手机号 */
18
+ phone: string
19
+ /** 用户名称 */
20
+ userName: string
21
+ /** 邮箱 */
22
+ email: string
23
+ /** 头像 */
24
+ headPicture: string
25
+ }
26
+
27
+ export interface TenantInfo {
28
+ /** 用户ID */
29
+ userId: string
30
+ /** 用户名 */
31
+ userName: string
32
+ name: string
33
+ /** 租户信息 */
34
+ tenant: {
35
+ id: string
36
+ name: string
37
+ adminUserId: string
38
+ description: string
39
+ domain: string
40
+ }
41
+ /** 用户标识 2 - B端身份, 4 - C 端身份, 6 - B+C 端身份 */
42
+ flag: number
43
+ areaCode: string
44
+ /** 手机号 */
45
+ phone: string
46
+ }
47
+
48
+ export interface HomeInfo {
49
+ /** 应用code */
50
+ applicationCode: string
51
+ /** 应用path */
52
+ applicationPath: string
53
+ /** 是否启用 */
54
+ enable: boolean
55
+ originalCode: string
56
+ routeUrl: string
57
+ type: number | null
58
+ }
59
+
60
+ export interface PersonalConfigInfo {
61
+ /** 侧边栏菜单风格(1:弹出式;2:内嵌式 )*/
62
+ style: 1 | 2
63
+ /** 皮肤风格 (default:默认皮肤;kjl:科技蓝;cjb:纯净白;ssl:深邃蓝)*/
64
+ skinStyle: 'default' | 'kjl' | 'cjb' | 'ssl'
65
+ }
66
+
67
+ export interface ProjectInfo {
68
+ /** 项目id */
69
+ id: string
70
+ /** 项目编码 */
71
+ code: string
72
+ /** 项目名称 */
73
+ name: string
74
+ /** 项目类型: 1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
75
+ type: string
76
+ /** 父级id */
77
+ parentId?: string
78
+ /** 父级名称 */
79
+ parentName?: string
80
+ /** 父级项目类型:1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
81
+ parentType?: number
82
+ /** 租户id */
83
+ tenantId?: string
84
+ /** 是否父级节点 */
85
+ isParent?: boolean
86
+ /** 是否叶子节点 */
87
+ leaf?: boolean
88
+ /** 是否可用 */
89
+ optional?: boolean
90
+ }
91
+
92
+ export interface ProjectMessage {
93
+ /** 主键id */
94
+ id: number | string
95
+ /** 项目名称 */
96
+ projectName: string
97
+ /** 省级(省份、直辖市、自治区)编码 */
98
+ provinceCode: string
99
+ /** 地级(城市)编码 */
100
+ cityCode: string
101
+ /** 县级(区县)编码 */
102
+ areaCode: string
103
+ /** 详细位置 */
104
+ address: string
105
+ /** 项目简介 */
106
+ projectDesc: string
107
+ /** 项目图片路径 */
108
+ logoPath: string
109
+ /** 项目类型 */
110
+ projectType: string
111
+ /** 项目类型code */
112
+ projectTypeCode: string
113
+ /** 经度 */
114
+ longitude: string
115
+ /** 纬度 */
116
+ latitude: string
117
+ /** 项目开始时间 */
118
+ projectStartDate: string
119
+ /** 项目有效期 */
120
+ projectExpiryDate: string
121
+ /** 项目编码 */
122
+ projectCode: string
123
+ /** 地图配置是否开启 */
124
+ mapConfiguration: boolean
125
+ /** 地级(城市)名称 */
126
+ cityName: string
127
+ /** 地级(城市)名称拼音 */
128
+ cityNamePinyin: string
129
+ /** 时区ID */
130
+ timezone: string
131
+ /** 是否自动设定时区 */
132
+ autoTimezone: boolean
133
+ /** 货币信息(currencyCode:ISO 4217货币编码(例:CNY);currencyUnit:货币单位,例:元(中文),CNY(英文);currencySymbol:货币符号,例:¥) */
134
+ currency: Record<'currencyCode' | 'currencyUnit' | 'currencySymbol', string>
135
+ }
136
+
137
+ export interface SubAppsInfo {
138
+ /** 所有应用信息 */
139
+ appcategorys?: any[]
140
+ /** 当前应用完整信息 */
141
+ currentSubApp?: any
142
+ /** 所有应用 */
143
+ flatSubAppList?: any[]
144
+ /** 当前应用code */
145
+ currentSubAppCode?: string
146
+ /** 当前打开的应用 */
147
+ subAppList?: any[]
148
+ /** 当前菜单折叠的应用key集合 */
149
+ menuCollapses?: any[]
150
+ }
151
+
152
+ interface TabItem {
153
+ /** 当前应用url */
154
+ currentApplication: string
155
+ /** 当前加载的应用 */
156
+ applicationPath: string
157
+ applicationCode: string
158
+ menuId: string
159
+ name: string
160
+ path: string
161
+ code: string
162
+ query?: any
163
+ }
164
+ export interface TabInfo {
165
+ /** 当前tabs key */
166
+ currentCode?: string
167
+ /** 当前tabs */
168
+ currentTab?: TabItem
169
+ /** 用于记录该应用上次开启的tab */
170
+ preTab?: Record<string, TabItem>
171
+ /** 当前打开的tabs(微前端环境会存入) */
172
+ tabMap?: Record<string, TabItem[]>
173
+ }
174
+
175
+ export type permissionBtnInfo = { code?: string; name?: string }[]
Binary file
Binary file
Binary file
@@ -1,89 +1,89 @@
1
1
  import { AxiosInstance, AxiosRequestConfig, AxiosError } from 'axios';
2
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
- >
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
+ >
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/utils",
3
- "version": "6.4.0-dev.57",
3
+ "version": "6.4.0-dev.59",
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.4.0-dev.57",
12
+ "@das-fed/utils": "6.4.0-dev.59",
13
13
  "@vue/shared": "^3.4.21",
14
14
  "@vueuse/core": "^9.6.0",
15
15
  "axios": "^1.6.7",
@@ -21,8 +21,8 @@
21
21
  "vue": "^3.4.21"
22
22
  },
23
23
  "devDependencies": {
24
- "@das-fed/cli": "6.4.0-dev.57",
25
- "@das-fed/web": "6.4.0-dev.57",
24
+ "@das-fed/cli": "6.4.0-dev.59",
25
+ "@das-fed/web": "6.4.0-dev.59",
26
26
  "@types/js-cookie": "^3.0.6",
27
27
  "@types/lodash-es": "^4.17.12",
28
28
  "@types/qs": "^6.9.15",
Binary file
package/style/index.js.gz CHANGED
Binary file
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as v, computed as u, onMounted as g, onBeforeUnmount as _, ref as L, openBlock as y, createElementBlock as h } from "vue";
2
- const x = ["src"], C = /* @__PURE__ */ v({
2
+ const x = ["src"], b = /* @__PURE__ */ v({
3
3
  __name: "low-code-iframe",
4
4
  props: {
5
5
  app: {},
@@ -58,12 +58,12 @@ const x = ["src"], C = /* @__PURE__ */ v({
58
58
  onLoad: w
59
59
  }, null, 40, x));
60
60
  }
61
- }), M = (n, c) => {
61
+ }), C = (n, c) => {
62
62
  const s = n.__vccOpts || n;
63
63
  for (const [a, r] of c)
64
64
  s[a] = r;
65
65
  return s;
66
- }, B = /* @__PURE__ */ M(C, [["__scopeId", "data-v-67190e50"]]);
66
+ }, B = /* @__PURE__ */ C(b, [["__scopeId", "data-v-c5870bec"]]);
67
67
  export {
68
68
  B as LowCode
69
69
  };
Binary file
@@ -1 +1 @@
1
- .low-code-iframe[data-v-67190e50]{padding:0;margin:0;border:none;outline:none;height:100%;width:100%;min-height:100px;min-width:100px}
1
+ .low-code-iframe[data-v-c5870bec]{padding:0;margin:0;border:none;outline:none;height:100%;width:100%;min-height:100px;min-width:100px}
Binary file
@@ -1,28 +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
- }
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
+ }