import axios from 'axios'
var instance = axios.create({
headers: {
'Content-Type': 'application/json',
'Accept': 'application/vnd.kangxiinfo.api-2.0+json',
'Cookie': 'apiType=1;appType=1;appVer=2.0;cType=1;',
},
withCredentials: true
});
instance.defaults.withCredentials=true
后台设置了拦截,这一段为了一开始请求到数据,但是一直请求不到。
切换到console标签,看看是不是有错误。感觉应该是跨域被拦截了。