diff --git a/src/components/GlobalHeader/index.js b/src/components/GlobalHeader/index.js index b0b93f8a0..303a08114 100644 --- a/src/components/GlobalHeader/index.js +++ b/src/components/GlobalHeader/index.js @@ -27,6 +27,7 @@ import { Modal, } from "antd"; import { connect } from "dva"; +import { withRouter } from "dva/router"; import AddModal from "./AddModal"; import ImportResultModal from "./ImportResultModal"; import styles from "./index.less"; @@ -236,8 +237,17 @@ class GlobalHeader extends PureComponent { loading, namespaces, currentNamespaceId, + location: { pathname }, } = this.props; const { popup, userName, visible } = this.state; + const showNamespaces = !~[ + "/config/dict", + "/config/namespace", + "/config/pluginhandle", + "/system/resource", + "/system/role", + "/system/manage", + ].indexOf(pathname); const menu = (
-
- - {namespaces.map((namespace) => { - let isCurrentNamespace = - currentNamespaceId === namespace.namespaceId; - return ( - - {namespace.name} - - ); - })} -
- } - > - - - + {showNamespaces && ( +
+ + {namespaces.map((namespace) => { + let isCurrentNamespace = + currentNamespaceId === namespace.namespaceId; + return ( + + {namespace.name} + + ); + })} + + } + > + + +
+ )}
+ +
+ + } visible cancelText={getIntlContent("SHENYU.COMMON.CLOSE")} onCancel={handleCancel}