Commit 025f177c by 姜雷

打印登出信息

parent d15ea41f
...@@ -17,9 +17,14 @@ export const validateCode = res => { ...@@ -17,9 +17,14 @@ export const validateCode = res => {
type: 'warning', type: 'warning',
} }
).then(() => { ).then(() => {
store.dispatch('FedLogOut').then(() => { store
location.reload(); // 为了重新实例化vue-router对象 避免bug .dispatch('FedLogOut')
}); .then(() => {
location.reload(); // 为了重新实例化vue-router对象 避免bug
})
.catch(err => {
console.error('FedLogOutErr: ', err);
});
}); });
return Promise.reject(res); return Promise.reject(res);
default: default:
......
...@@ -24,10 +24,10 @@ const createBaseFetch = config => { ...@@ -24,10 +24,10 @@ const createBaseFetch = config => {
store.dispatch('fetchStart', notLoading); store.dispatch('fetchStart', notLoading);
if (store.getters.token) { if (store.getters.token) {
conf.headers = { conf.headers = {
...conf.headers,
reqSource: 'pc', reqSource: 'pc',
token: store.getters.token, token: store.getters.token,
ip: ip, ip: ip,
...conf.headers,
}; };
} else { } else {
conf.headers = { conf.headers = {
......
...@@ -66,6 +66,7 @@ const actions = { ...@@ -66,6 +66,7 @@ const actions = {
// 前端 登出 // 前端 登出
FedLogOut({ commit }) { FedLogOut({ commit }) {
return new Promise(resolve => { return new Promise(resolve => {
console.debug('in FedLogOut');
commit(SET_TOKEN, ''); commit(SET_TOKEN, '');
removeToken(); removeToken();
resolve(); 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