import axios from "axios" import qs from "qs" axios.interceptors.request.use(req=>{
//添加请求头处理登录和注册外 if(req.url!="/login"&&req.url!="/register"){ req.headers.token=sessionStorage.getItem("token") } return req; }) axios.interceptors.response.use(res=>{ console.log("本次请求的地址是:"+ res.config.url); console.log(res); if(!res.data.isok){ res.data.data=[] } return res; })