From dff0c8a0082aa41b96c9c64f2afd09e24138246e Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Mon, 11 May 2020 15:33:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9util.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/components/common/head/HeaderUser.vue | 8 +++----- .../src/business/components/project/MsProject.vue | 5 ++--- .../src/business/components/settings/CurrentUser.vue | 5 ++--- .../settings/organization/OrganizationMember.vue | 5 ++--- .../settings/organization/OrganizationWorkspace.vue | 7 +++---- .../components/settings/personal/PersonSetting.vue | 4 ++-- .../settings/workspace/WorkspaceMember.vue | 5 ++--- frontend/src/common/js/utils.js | 12 ++++++------ 8 files changed, 22 insertions(+), 29 deletions(-) diff --git a/frontend/src/business/components/common/head/HeaderUser.vue b/frontend/src/business/components/common/head/HeaderUser.vue index 685bfb86fb..59e63f8500 100644 --- a/frontend/src/business/components/common/head/HeaderUser.vue +++ b/frontend/src/business/components/common/head/HeaderUser.vue @@ -51,7 +51,7 @@ TokenKey, WORKSPACE_ID } from '../../../../common/js/constants'; - import {hasRoles, saveLocalStorage} from "../../../../common/js/utils"; + import {getCurrentUser, hasRoles, saveLocalStorage} from "../../../../common/js/utils"; export default { name: "MsUser", @@ -68,7 +68,7 @@ {index: '2-1', name: '无工作空间'}, ], currentUserInfo: {}, - currentUserId: JSON.parse(localStorage.getItem(TokenKey)).id, + currentUserId: getCurrentUser().id, workspaceIds: [], currentOrganizationName: '选择组织', currentWorkspaceName: '选择工作空间' @@ -76,9 +76,7 @@ }, computed: { currentUser: () => { - let user = localStorage.getItem(TokenKey); - // window.console.log(user); - return JSON.parse(user); + return getCurrentUser(); } }, methods: { diff --git a/frontend/src/business/components/project/MsProject.vue b/frontend/src/business/components/project/MsProject.vue index 5877d731f5..e95ce0728d 100644 --- a/frontend/src/business/components/project/MsProject.vue +++ b/frontend/src/business/components/project/MsProject.vue @@ -44,11 +44,11 @@