From 30a141c92e1aaa06b5b93f191e74a9be76287c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= <792998983@qq.com> Date: Wed, 1 Sep 2021 10:58:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9nopage=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppConfig.js | 6 ++-- src/forge/users/Index.jsx | 75 +++++---------------------------------- 2 files changed, 11 insertions(+), 70 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index aa966b8b7..381ce19ac 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -11,9 +11,9 @@ broadcastChannelOnmessage('refreshPage', () => { }) function locationurl(list) { - // if (window.location.port !== "3007") { + if (window.location.port !== "3007") { window.location.href = list - // } + } } // TODO 开发期多个身份切换 let debugType = "" @@ -85,7 +85,7 @@ export function initAxiosInterceptors(props) { } if (response.data.status === 404) { - let responseURL = response.data.request ? response.data.request.responseURL:''; + let responseURL = response.request ? response.request.responseURL:''; if (responseURL.indexOf('/api/users/') === -1 && responseURL.indexOf('/api/organizations/') === -1) { locationurl('/nopage'); } diff --git a/src/forge/users/Index.jsx b/src/forge/users/Index.jsx index 8737e5caa..c1438d824 100644 --- a/src/forge/users/Index.jsx +++ b/src/forge/users/Index.jsx @@ -17,78 +17,19 @@ const Projects = Loadable({ }) export default withRouter( (CNotificationHOC()(SnackbarHOC()(TPMIndexHOC((props) => { + console.log(props.location.pathname); + let secondRouter = ''; + if (props.location.pathname) { + secondRouter = props.location.pathname.split('/')[2]; + } + let userRouterArr = ['statistics', 'projects', 'notice', 'devops', 'organizes', 'info', 'watchers', 'fan_users', 'password']; return ( - - ( - - )} - > - - ( - - )} - > - - ( - - )} - > - - ( - - )} - > - - ( - - )} - > - - ( - - )} - > - - ( - - )} - > - - ( - - )} - > - - { - return () - } - }> - - ( - + secondRouter && (!userRouterArr.includes(secondRouter)) ? + : )} >