1、配置接口地址:
axios.defaults.baseURL ="https://www.baidu.com/"
2、允许ajax携带cookie ( axios 默认是不允许ajax请求头携带cookie ) :
axios.defaults.withCredentials = true
3、配置请求超时时间:
axios.defaults.timeout = 5000;
4、配置全局求头:
axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded';
网友评论