From 8c105a30fac50817cf32e51906f6299ed14b9eea Mon Sep 17 00:00:00 2001 From: Raod <1130305001@qq.com> Date: Tue, 29 Jun 2021 09:30:05 +0800 Subject: [PATCH] login --- report-ui/src/utils/request.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/report-ui/src/utils/request.js b/report-ui/src/utils/request.js index 81b3eae8..d31ab113 100644 --- a/report-ui/src/utils/request.js +++ b/report-ui/src/utils/request.js @@ -1,6 +1,7 @@ import axios from 'axios' import { Message, MessageBox } from 'element-ui' import store from '../store' +import { delItem } from "@/utils/storage" import { getToken } from '@/utils/auth' // 创建axios实例 const service = axios.create({ @@ -38,11 +39,9 @@ service.interceptors.response.use( type: 'warning' } ).then(() => { - // store.dispatch('FedLogOut').then(() => { - // // location.reload() // 为了重新实例化vue-router对象 避免bug - // window.location.href = "/"; - // }) - location.reload(); + delItem('token') + sessionStorage.clear() + localStorage.clear() window.location.href = "/"; }) }