From 1984a2378390800ed08f53660c27d5be584257c1 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Thu, 11 Nov 2021 10:30:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8D=E5=90=8C=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E7=99=BB=E9=99=86=E4=B9=8B=E5=90=8E=E8=B7=B3=E8=BD=AC=E4=B8=8D?= =?UTF-8?q?=E5=90=8C=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/business/components/common/router/router.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/frontend/src/business/components/common/router/router.js b/frontend/src/business/components/common/router/router.js index 0a69c7d333..857f41be43 100644 --- a/frontend/src/business/components/common/router/router.js +++ b/frontend/src/business/components/common/router/router.js @@ -58,13 +58,10 @@ VueRouter.prototype.push = function push(location) { // 登入后跳转至原路径 function redirectLoginPath(originPath) { - let redirectUrl = ''; + let redirectUrl = sessionStorage.getItem('redirectUrl'); let loginSuccess = sessionStorage.getItem('loginSuccess'); - if (getCurrentUserId() === sessionStorage.getItem('lastUser')) { - redirectUrl = sessionStorage.getItem('redirectUrl'); - } - if (!redirectUrl) { + if (!redirectUrl || redirectUrl === '/') { if (hasPermissions('PROJECT_USER:READ', 'PROJECT_ENVIRONMENT:READ', 'PROJECT_OPERATING_LOG:READ', 'PROJECT_FILE:READ+JAR', 'PROJECT_FILE:READ+FILE', 'PROJECT_CUSTOM_CODE:READ')) { redirectUrl = '/project/home'; } else if (hasPermissions('WORKSPACE_SERVICE:READ', 'WORKSPACE_MESSAGE:READ', 'WORKSPACE_USER:READ', 'WORKSPACE_PROJECT_MANAGER:READ', 'WORKSPACE_PROJECT_ENVIRONMENT:READ', 'WORKSPACE_OPERATING_LOG:READ', 'WORKSPACE_TEMPLATE:READ')) {