cfel-base-components 2.6.2 → 2.6.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cfel-base-components",
3
- "version": "2.6.2",
3
+ "version": "2.6.4",
4
4
  "description": "cfel-base-components",
5
5
  "main": "/src/index.tsx",
6
6
  "types": "src/index.d.ts",
@@ -63,7 +63,7 @@ instance.interceptors.response.use(
63
63
  })
64
64
  // 如果后端在非2xx响应中也返回了业务 errorCode,处理 PRODUCT_NOT_REGISTRY
65
65
  const respData = response?.data || {}
66
- if (respData && respData.errorCode === 'PRODUCT_NOT_REGISTRY') {
66
+ if ((respData && respData.errorCode === 'PRODUCT_NOT_REGISTRY') || respData.errorCode === 'ACCESS_DENIED') {
67
67
  if (typeof (window as any).showProductNotRegisteredOverlay === 'function') {
68
68
  ;(window as any).showProductNotRegisteredOverlay({
69
69
  onAction: () => {},
@@ -633,7 +633,6 @@ body {
633
633
  padding-left: 16px;
634
634
  display: flex;
635
635
  justify-content: space-between;
636
- cursor: pointer;
637
636
  height: 30px;
638
637
  position: relative;
639
638
  z-index: 11;
@@ -11,6 +11,9 @@ interface TreeNode {
11
11
  children?: TreeNode[]
12
12
  }
13
13
 
14
+ const homeEnabled = window?.g_config?.homeEnabled
15
+ const homeUrl = window?.g_config?.homeUrl
16
+
14
17
  export interface LiosLayoutlProps {
15
18
  appName?: any
16
19
  productCode: string
@@ -233,11 +236,13 @@ export default function LiosLayout(props: LiosLayoutlProps) {
233
236
  <div className="header-logo" style={{ justifyContent: collapsed ? 'center' : '', paddingLeft: collapsed ? '0' : '' }}>
234
237
  <div
235
238
  onClick={() => {
236
- window.open('/home')
239
+ if (homeEnabled && homeUrl) {
240
+ window.open(homeUrl, '_self')
241
+ }
237
242
  }}
238
243
  >
239
- {!collapsed && <img className={`logo-base current-logo`} src={logo || logoUrl} />}
240
- {collapsed && <img className={`logo-sub`} src={subLogo || subLogoUrl} />}
244
+ {!collapsed && <img style={{ cursor: homeEnabled ? 'pointer' : 'default' }} className={`logo-base current-logo`} src={logo || logoUrl} />}
245
+ {collapsed && <img style={{ cursor: homeEnabled ? 'pointer' : 'default' }} className={`logo-sub`} src={subLogo || subLogoUrl} />}
241
246
  </div>
242
247
  {!collapsed && (
243
248
  <div
package/src/global.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  declare global {
2
2
  interface Window {
3
3
  g_config: {
4
+ homeEnabled: boolean
5
+ homeUrl: string
4
6
  token: string
5
7
  tenant: Tenant
6
8
  custom: Custom