consthttp=axios.create({method,baseUrl,url,headers:{'Content-Type':'application/json',},...})http.interceptors.request.use(config=>{if(config.method==='get'){// 给data赋值以绕过if判断config.data=true}config.headers['Content-Type']='application/json'returnconfig},err=>Promise.reject(err))...