From c182387cce09a9223801575bab284f6eb0301e47 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 17 Jun 2021 19:33:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=99=BB=E5=87=BA=E6=B8=85=E7=A9=BA?= =?UTF-8?q?=E4=BA=86localStorage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/business/components/common/head/HeaderUser.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/business/components/common/head/HeaderUser.vue b/frontend/src/business/components/common/head/HeaderUser.vue index bcb9052aa4..b96dab93ca 100644 --- a/frontend/src/business/components/common/head/HeaderUser.vue +++ b/frontend/src/business/components/common/head/HeaderUser.vue @@ -28,7 +28,7 @@ import {getCurrentUser} from "@/common/js/utils"; import AboutUs from "./AboutUs"; import axios from "axios"; import {mapGetters} from "vuex"; -import {ORGANIZATION_ID, PROJECT_ID, WORKSPACE_ID} from "@/common/js/constants"; +import {ORGANIZATION_ID, PROJECT_ID, TokenKey, WORKSPACE_ID} from "@/common/js/constants"; const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/); const auth = requireComponent.keys().length > 0 ? requireComponent("./auth/Auth.vue") : {}; @@ -53,7 +53,7 @@ export default { logout: function () { axios.get("/signout").then(response => { if (response.data.success) { - localStorage.clear(); + localStorage.removeItem(TokenKey); sessionStorage.removeItem(ORGANIZATION_ID); sessionStorage.removeItem(WORKSPACE_ID); @@ -61,7 +61,7 @@ export default { window.location.href = "/login"; } }).catch(error => { - localStorage.clear(); + localStorage.removeItem(TokenKey); sessionStorage.removeItem(ORGANIZATION_ID); sessionStorage.removeItem(WORKSPACE_ID);