liuyg
2022-03-16 e4be7a095f31b76d4f3d60c06eefe774ffd264fc
src/router/axios.js
@@ -8,12 +8,20 @@
import axios from 'axios';
import store from '@/store/';
import router from '@/router/router';
import { serialize } from '@/util/util';
import { getToken } from '@/util/auth';
import {
  serialize
} from '@/util/util';
import {
  getToken
} from '@/util/auth';
// import { Message } from 'element-ui';
import { MessageBox } from 'element-ui';
import {
  MessageBox
} from 'element-ui';
import website from '@/config/website';
import { Base64 } from 'js-base64';
import {
  Base64
} from 'js-base64';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
@@ -63,7 +71,9 @@
  //如果在白名单里则自行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(() => router.push({
    path: '/login'
  }));
  // 如果请求为非200否者默认统一处理
  if (status !== 200 & status !== 201) {
    // Message({