Commit 249f0c54 authored by 冷冷's avatar 冷冷

🎉 🎉 🎉 v2.0.0

parent ca38b665
...@@ -12,6 +12,7 @@ import {getStore} from '../util/store' ...@@ -12,6 +12,7 @@ import {getStore} from '../util/store'
import {getToken} from '@/util/auth' import {getToken} from '@/util/auth'
import NProgress from 'nprogress' // progress bar import NProgress from 'nprogress' // progress bar
import errorCode from '@/const/errorCode' import errorCode from '@/const/errorCode'
import router from "@/router/router"
import {Message} from 'element-ui' import {Message} from 'element-ui'
import 'nprogress/nprogress.css' // progress bar style import 'nprogress/nprogress.css' // progress bar style
axios.defaults.timeout = 30000 axios.defaults.timeout = 30000
...@@ -57,13 +58,16 @@ axios.interceptors.response.use(res => { ...@@ -57,13 +58,16 @@ axios.interceptors.response.use(res => {
}) })
return Promise.reject(new Error(message)) return Promise.reject(new Error(message))
} }
if (status === 401) { if (status === 401) {
store.dispatch('FedLogOut').then(() => { store.dispatch('FedLogOut').then(() => {
router.push({ router.push({
path: '/login' path: '/login'
}) })
}) })
return
} }
if (status !== 200) { if (status !== 200) {
Message({ Message({
message: message, message: message,
......
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