From 1c7dc61c4440074326f8c888b2d9dd04ad1ec29e Mon Sep 17 00:00:00 2001 From: leoliu Date: Fri, 21 Feb 2020 14:21:05 +0800 Subject: [PATCH] fix: Fix app manage page logout redirect --- server/libs/utils.js | 4 ++-- src/components/Layout/LoginInfo/index.jsx | 5 ++++- src/utils/index.js | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/server/libs/utils.js b/server/libs/utils.js index 3c57373dbb1..09b696384e4 100644 --- a/server/libs/utils.js +++ b/server/libs/utils.js @@ -127,8 +127,8 @@ const isValidReferer = path => * @param path koa ctx.path */ const isAppsRoute = path => { - const regex = pathToRegex('/apps(/?.*)') - return regex.exec(path) + const regex = pathToRegex('/apps/app-(.*)') + return path === '/apps' || regex.exec(path) } /** diff --git a/src/components/Layout/LoginInfo/index.jsx b/src/components/Layout/LoginInfo/index.jsx index fc38ccfd091..d031893a4ac 100644 --- a/src/components/Layout/LoginInfo/index.jsx +++ b/src/components/Layout/LoginInfo/index.jsx @@ -135,7 +135,10 @@ export default class LoginInfo extends Component { secondary: '#8d663e', }} /> - + {t('Login KubeSphere')} diff --git a/src/utils/index.js b/src/utils/index.js index 3f36514c0f5..cec02595013 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -456,4 +456,4 @@ export const withDryRun = async requests => { * @param {String} path */ export const isAppsPage = (path = location.pathname) => - path === '/apps' || path.startsWith('/apps/') + path === '/apps' || path.startsWith('/apps/app-')