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

增加未授权页面

上级 03544c39
差异被折叠。
export default [
{ path: '*', redirect: '/' },
{ path: '/', component: () => import('@/pages/home/index.vue') }
{ path: '/', component: () => import('@/pages/home/index.vue') },
{ path: '/403', name: '403', component: () => import('@/pages/exception/403.vue') }
]
import axios from 'axios'
import router from '@/router'
const httpRequest = axios.create({
baseURL: webConf.others.baseUrl,
timeout: 60000,
......@@ -26,6 +27,9 @@ httpRequest.interceptors.response.use(
if (code === 401) {
window.location.href = `${webConf.others.loginUrl}?rd=${encodeURIComponent(window.location.href)}`
}
if (code === 402) {
router.push('/403')
}
if (code !== 200) {
return Promise.reject(data)
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论