404、403等页面隐藏侧边栏

This commit is contained in:
黄心宇 2024-04-26 15:56:32 +08:00
parent df7fd1cf21
commit cbb1368f15
1 changed files with 8 additions and 5 deletions

View File

@ -354,19 +354,22 @@ export function TPMIndexHOC(WrappedComponent) {
}
hideNavPath = (path) => {
const hidePath = ['/statistics', '/projects', '/notice', '/organizes', '']
const hideUserPath = ['/statistics', '/projects', '/notice', '/organizes', '']
const hidePath = ['/nopage', '/403', '/500', '/organize/new', '/settings/profile']
let hide = false
const {current_user} = this.state;
hidePath.forEach(e => {
hideUserPath.forEach(e => {
if (path === `/${current_user && current_user.login}${e}`) {
hide = true
}
})
hidePath.forEach(e => {
if (path === e) {
hide = true
}
})
// 组织页不要
if (this.props.pathType === 'Organization') hide = true
if (path === `/organize/new`) hide = true
// 设置页不要
if (path === `/settings/profile`) hide = true
return hide
}