cfel-base-components 2.5.75 → 2.5.77
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/package.json +1 -1
- package/src/.umi/core/helmet.ts +1 -1
- package/src/apiRequest/config.ts +54 -36
- package/src/components/layout/index.tsx +1 -4
- package/.vscode/settings.json +0 -3
- package/src/components/layout-cloud/index-cloud.scss +0 -886
- package/src/components/layout-cloud/index.tsx +0 -753
- package/src/components/layout-cloud/user-card/index.scss +0 -180
- package/src/components/layout-cloud/user-card/index.tsx +0 -162
- package/src/components/layout-console/index-console.scss +0 -943
- package/src/components/layout-console/index.tsx +0 -742
- package/src/components/layout-console/user-card/index.scss +0 -180
- package/src/components/layout-console/user-card/index.tsx +0 -162
package/package.json
CHANGED
package/src/.umi/core/helmet.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// This file is generated by Umi automatically
|
|
3
3
|
// DO NOT CHANGE IT MANUALLY!
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { HelmetProvider } from '/Users/
|
|
5
|
+
import { HelmetProvider } from '/Users/lionaillen/Documents/work/cfel/base-components/node_modules/.pnpm/@umijs+renderer-react@4.0.72_react-dom@18.1.0_react@18.1.0__react@18.1.0/node_modules/@umijs/renderer-react';
|
|
6
6
|
import { context } from './helmetContext';
|
|
7
7
|
|
|
8
8
|
export const innerProvider = (container) => {
|
package/src/apiRequest/config.ts
CHANGED
|
@@ -1,75 +1,93 @@
|
|
|
1
|
-
import axios, { AxiosRequestHeaders } from
|
|
2
|
-
import { notification } from
|
|
1
|
+
import axios, { AxiosRequestHeaders } from 'axios'
|
|
2
|
+
import { notification } from 'antd'
|
|
3
3
|
|
|
4
|
-
let UMI_APP_BASEURL: any = window.location.origin || process.env
|
|
5
|
-
const instance = axios.create({ baseURL: UMI_APP_BASEURL })
|
|
4
|
+
let UMI_APP_BASEURL: any = window.location.origin || process.env
|
|
5
|
+
const instance = axios.create({ baseURL: UMI_APP_BASEURL })
|
|
6
6
|
|
|
7
7
|
instance.interceptors.request.use(
|
|
8
8
|
(config: any) => {
|
|
9
9
|
config.headers = {
|
|
10
10
|
...config.headers,
|
|
11
|
-
} as AxiosRequestHeaders
|
|
11
|
+
} as AxiosRequestHeaders
|
|
12
12
|
|
|
13
13
|
config.params = {
|
|
14
14
|
...config.params,
|
|
15
15
|
productCode: (window as any)?.g_config?.productCode,
|
|
16
|
-
}
|
|
16
|
+
}
|
|
17
17
|
|
|
18
|
-
return config
|
|
18
|
+
return config
|
|
19
19
|
},
|
|
20
20
|
(error: any) => Promise.reject(error)
|
|
21
|
-
)
|
|
21
|
+
)
|
|
22
22
|
|
|
23
23
|
instance.interceptors.response.use(
|
|
24
24
|
//状态码为2xx的时候执行
|
|
25
25
|
(response: any) => {
|
|
26
|
-
const { data = {} } = response
|
|
27
|
-
const { success, content, errorCode, errorMsg } = data
|
|
26
|
+
const { data = {} } = response
|
|
27
|
+
const { success, content, errorCode, errorMsg } = data
|
|
28
28
|
|
|
29
29
|
if (!success) {
|
|
30
30
|
notification.error({
|
|
31
31
|
message: errorMsg,
|
|
32
|
-
})
|
|
33
|
-
return Promise.reject(data)
|
|
32
|
+
})
|
|
33
|
+
return Promise.reject(data)
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
return content
|
|
36
|
+
return content
|
|
37
37
|
},
|
|
38
38
|
//状态码不为2xx的时候执行
|
|
39
39
|
(error: any) => {
|
|
40
|
-
const { response = {} } = error
|
|
41
|
-
const { status } = response
|
|
40
|
+
const { response = {} } = error
|
|
41
|
+
const { status } = response
|
|
42
42
|
|
|
43
|
-
if (error.code ===
|
|
44
|
-
return Promise.reject(error)
|
|
43
|
+
if (error.code === 'ERR_CANCELED') {
|
|
44
|
+
return Promise.reject(error)
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
enum CodeMessage {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
48
|
+
'发出的请求有错误,服务器没有进行新建或修改数据的操作。' = 400,
|
|
49
|
+
'用户未登录。' = 401,
|
|
50
|
+
'用户未得到授权,访问是被禁止的。' = 403,
|
|
51
|
+
'发出的请求针对的是不存在的记录,服务器没有进行操作。' = 404,
|
|
52
|
+
'请求的格式不可得。' = 406,
|
|
53
|
+
'请求的资源被永久删除,且不会再得到的。' = 410,
|
|
54
|
+
'当创建一个对象时,发生一个验证错误。' = 422,
|
|
55
|
+
'服务器发生错误,请检查服务器。' = 500,
|
|
56
|
+
'网关错误。' = 502,
|
|
57
|
+
'服务不可用,服务器暂时过载或维护。' = 503,
|
|
58
|
+
'网关超时。' = 504,
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
notification.error({
|
|
62
|
-
message:
|
|
63
|
-
|
|
64
|
-
CodeMessage[status] ||
|
|
65
|
-
"服务暂不可用,请检查网络",
|
|
66
|
-
});
|
|
62
|
+
message: response?.data?.errorMsg || CodeMessage[status] || '服务暂不可用,请检查网络',
|
|
63
|
+
})
|
|
67
64
|
|
|
68
65
|
if (status === 401) {
|
|
69
66
|
}
|
|
70
67
|
|
|
71
|
-
return Promise.reject(error)
|
|
68
|
+
return Promise.reject(error)
|
|
72
69
|
}
|
|
73
|
-
)
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
export default instance
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* 通用请求方法,支持类型推断
|
|
76
|
+
*/
|
|
77
|
+
export function request<T = any>(config: Parameters<typeof instance.request>[0]) {
|
|
78
|
+
return instance.request<T, T>(config)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* GET 请求,支持类型推断
|
|
83
|
+
*/
|
|
84
|
+
export function get<T = any>(url: string, config?: Omit<Parameters<typeof instance.get>[1], 'url'>) {
|
|
85
|
+
return instance.get<T, T>(url, config)
|
|
86
|
+
}
|
|
74
87
|
|
|
75
|
-
|
|
88
|
+
/**
|
|
89
|
+
* POST 请求,支持类型推断
|
|
90
|
+
*/
|
|
91
|
+
export function post<T = any>(url: string, data?: any, config?: Omit<Parameters<typeof instance.post>[2], 'url' | 'data'>) {
|
|
92
|
+
return instance.post<T, T>(url, data, config)
|
|
93
|
+
}
|
|
@@ -138,7 +138,6 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
138
138
|
tenantId: false,
|
|
139
139
|
})
|
|
140
140
|
|
|
141
|
-
|
|
142
141
|
useEffect(() => {
|
|
143
142
|
//在这里找到当前菜单的上层目录
|
|
144
143
|
const paMenu = findParentMenu(menuList, '/' + location.pathname.split('/')[2])
|
|
@@ -155,7 +154,6 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
155
154
|
setSelectKey(selectedPath)
|
|
156
155
|
}, [location.pathname])
|
|
157
156
|
|
|
158
|
-
|
|
159
157
|
const onOpenChange: MenuProps['onOpenChange'] = (keys) => {
|
|
160
158
|
// Find the last opened key
|
|
161
159
|
const latestOpenKey = keys.find((key) => openKeys.indexOf(key) === -1)
|
|
@@ -239,8 +237,7 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
239
237
|
}}
|
|
240
238
|
>
|
|
241
239
|
{!collapsed && <img className={`logo-base current-logo`} src={logo || logoUrl} />}
|
|
242
|
-
{collapsed && <img className={`logo-sub`} src={subLogoUrl} />}
|
|
243
|
-
{/* {collapsed && <img className={`logo-base sub-logo`} src={logo || subLogoUrl} />} */}
|
|
240
|
+
{collapsed && <img className={`logo-sub`} src={subLogo || subLogoUrl} />}
|
|
244
241
|
</div>
|
|
245
242
|
{!collapsed && (
|
|
246
243
|
<div
|
package/.vscode/settings.json
DELETED