提交 340bba26 authored 作者: 王鹏飞's avatar 王鹏飞

fix: 登录过期,调用退出登录接口

上级 e065ef9f
......@@ -2,7 +2,7 @@ import axios from 'axios'
import qs from 'qs'
import { Notify } from 'vant'
import router from '@/router'
import { logout } from '@/api/account'
const httpRequest = axios.create({
baseURL: process.env.VUE_APP_BASE_API,
timeout: 60000,
......@@ -39,10 +39,12 @@ httpRequest.interceptors.response.use(
if (status === 400) {
Notify(message)
} else if (status === 403) {
logout().then(() => {
router.replace({
path: '/login',
query: { redirect_uri: encodeURIComponent(window.location.href) }
})
})
}
} else {
Notify(error)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论