// 对token过期拦截
ElMessageBox.confirm('登录已过期,返回登录页?', '系统提示', {
confirmButtonText: '确认',
type: 'warning'
}).then(() => {
window.location.href = '/'
//对本地存储数据清除
})
return Promise.reject(new Error(res.msg || '请求错误')) //加上这一句可以阻止多个弹窗
// 对token过期拦截
ElMessageBox.confirm('登录已过期,返回登录页?', '系统提示', {
confirmButtonText: '确认',
type: 'warning'
}).then(() => {
window.location.href = '/'
//对本地存储数据清除
})
return Promise.reject(new Error(res.msg || '请求错误')) //加上这一句可以阻止多个弹窗