flat: 添加30分钟退出功能

This commit is contained in:
Apcallover
2024-05-10 16:45:20 +08:00
parent 5f1c2f1a7d
commit c839003715
3 changed files with 37 additions and 2 deletions

View File

@@ -60,8 +60,12 @@ axios.interceptors.response.use(
//如果在白名单里则自行catch逻辑处理
if (statusWhiteList.includes(status)) return Promise.reject(res);
//如果是401则跳转到登录页面
if (status === 401)
store.dispatch('FedLogOut').then(() => router.push({path: '/login'}));
if (status === 401) {
store.dispatch('FedLogOut').then(() => {
window.location.href = 'http://10.160.7.216:9920/casserver/login?service=http://10.165.0.77/manage/login&stService=http%3A%2F%2F10.165.0.77%2Fmanage%2Flogin'
});
// store.dispatch('FedLogOut').then(() => router.push({path: '/login'}));
}
// 如果请求为500统一处理
const err = new Error(message)
err.response = res