From 4ff5503c9bf86a951516e611b19c7d5bac1df712 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 22 Sep 2022 11:55:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E8=B7=AF=E7=94=B1=E5=88=B0=E6=96=B0=E6=89=93?= =?UTF-8?q?=E5=BC=80=E7=9A=84=E6=A0=87=E7=AD=BE=E9=A1=B5=E6=9C=89=E6=97=B6?= =?UTF-8?q?=E4=BC=9A=E8=B7=B3=E8=BD=AC=E5=88=B0=E4=B8=AA=E4=BA=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1017174 --user=李玉号 [系统设置]github #18019打开的标签页无论路径输入的什么,最后都会跳转到个人信息界面 https://www.tapd.cn/55049933/s/1250021 Closes #18019 --- frontend/src/common/js/utils.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/frontend/src/common/js/utils.js b/frontend/src/common/js/utils.js index e0700561f2..72a1e3e5d9 100644 --- a/frontend/src/common/js/utils.js +++ b/frontend/src/common/js/utils.js @@ -96,11 +96,19 @@ export function hasPermissions(...permissions) { } export function getCurrentWorkspaceId() { - return sessionStorage.getItem(WORKSPACE_ID); + let workspaceId = sessionStorage.getItem(WORKSPACE_ID); + if (workspaceId) { + return workspaceId; + } + return getCurrentUser().lastWorkspaceId; } export function getCurrentProjectID() { - return sessionStorage.getItem(PROJECT_ID); + let projectId = sessionStorage.getItem(PROJECT_ID); + if (projectId) { + return projectId; + } + return getCurrentUser().lastProjectId; } export function getCurrentUser() { @@ -607,11 +615,11 @@ export function operationConfirm(tip, success, cancel) { if (tip[tip.length - 1] !== '?' && tip[tip.length - 1] !== '?') { tip += '?'; } - return confirm(tip, '', { - confirmButtonText: i18n.t('commons.confirm'), - cancelButtonText: i18n.t('commons.cancel'), - type: 'warning', - center: false + return confirm(tip, '', { + confirmButtonText: i18n.t('commons.confirm'), + cancelButtonText: i18n.t('commons.cancel'), + type: 'warning', + center: false }).then(() => { if (success) { success(); @@ -620,7 +628,7 @@ export function operationConfirm(tip, success, cancel) { if (cancel) { cancel(); } - }); + }); }