From 5a8daf7cfe25c99e124741dc5aeefa9eb5b59f0e Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Fri, 16 Oct 2020 17:17:14 +0800 Subject: [PATCH] Change NewHeader active --- src/modules/tpm/NewHeader.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js index e064d4a7..63748f94 100644 --- a/src/modules/tpm/NewHeader.js +++ b/src/modules/tpm/NewHeader.js @@ -575,19 +575,11 @@ class NewHeader extends Component { matchpaths = (url) => { const { match } = this.props; if(url){ - if (url === '/forums' && match.path === '/forums') { + if (url.indexOf('forums') > -1 && match.path.indexOf('forums') > -1) { return true - } else if (url.startsWith('/projects') && match.path.startsWith('/projects')) { + } else if (url.indexOf('projects') > -1 && match.path.indexOf('projects') > -1) { return true - } else if (url.startsWith('/paths') && match.path.startsWith('/paths')) { - return true - } else if (url.startsWith('/courses') && match.path.startsWith('/courses')) { - return true - } else if (url.startsWith('/competitions') && match.path.startsWith('/competitions')) { - return true - } else if (url.startsWith('/statistics') && match.path.startsWith('/statistics')) { - return true - } else if (url.startsWith('/users') && match.path.startsWith('/users')) { + } else if (url.indexOf('users') > -1 && match.path.indexOf('users') > -1) { return true } else { return false