From 4bcfe27ac5b39f3f2fb61146da4afdf3371dfdce 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/business/components/common/head/HeaderUser.vue b/frontend/src/business/components/common/head/HeaderUser.vue index 59fb5744f8..55849c8e06 100644 --- a/frontend/src/business/components/common/head/HeaderUser.vue +++ b/frontend/src/business/components/common/head/HeaderUser.vue @@ -28,6 +28,7 @@ import {getCurrentUser} from "@/common/js/utils"; import AboutUs from "./AboutUs"; import axios from "axios"; import {mapGetters} from "vuex"; +import {TokenKey} from "@/common/js/constants"; const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/); const auth = requireComponent.keys().length > 0 ? requireComponent("./auth/Auth.vue") : {}; @@ -52,11 +53,11 @@ export default { logout: function () { axios.get("/signout").then(response => { if (response.data.success) { - localStorage.clear(); + localStorage.removeItem(TokenKey); window.location.href = "/login"; } }).catch(error => { - localStorage.clear(); + localStorage.removeItem(TokenKey); window.location.href = "/login"; }); },