Commit 025f177c by 姜雷

打印登出信息

parent d15ea41f
......@@ -17,9 +17,14 @@ export const validateCode = res => {
type: 'warning',
}
).then(() => {
store.dispatch('FedLogOut').then(() => {
location.reload(); // 为了重新实例化vue-router对象 避免bug
});
store
.dispatch('FedLogOut')
.then(() => {
location.reload(); // 为了重新实例化vue-router对象 避免bug
})
.catch(err => {
console.error('FedLogOutErr: ', err);
});
});
return Promise.reject(res);
default:
......
......@@ -24,10 +24,10 @@ const createBaseFetch = config => {
store.dispatch('fetchStart', notLoading);
if (store.getters.token) {
conf.headers = {
...conf.headers,
reqSource: 'pc',
token: store.getters.token,
ip: ip,
...conf.headers,
};
} else {
conf.headers = {
......
......@@ -66,6 +66,7 @@ const actions = {
// 前端 登出
FedLogOut({ commit }) {
return new Promise(resolve => {
console.debug('in FedLogOut');
commit(SET_TOKEN, '');
removeToken();
resolve();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment