Update axios.js

peiyanni 3 years ago
parent 290d53a345
commit 0487d2977b

@ -1,9 +1,5 @@
import axios from 'axios';
import { Message, MessageBox } from 'element-ui';
import { getItem, delItem } from '@/utils/storage';
import signUtil from '@/utils/signUtil';
import { deepClone } from "@/utils"
axios.defaults.baseURL = process.env.BASE_API
const service = axios.create({
withCredentials: false,
@ -15,8 +11,6 @@ const service = axios.create({
service.interceptors.request.use(
config => {
// 在发送请求之前做些什么
var token = getItem('token');
return config
},
error => {
@ -42,7 +36,6 @@ service.interceptors.response.use(
}).then(() => {
sessionStorage.clear();
localStorage.clear();
delItem('token')
window.location.href = "/";
}).catch(err => {
})

Loading…
Cancel
Save