$.ajax({
url: '接口地址',
type:'get', //请求方式get或post
data:{}, //请求所传的参数
dataType: 'json', //返回的数据格式
timeout: 4000, //设置时间超时,单位毫秒
success: function(result) {
console.log('OK')
},
error: console.log('error')
})
axios.post( //请求方式
url, //接口地址
params, //传递参数
{timeout: 1000 * 60 * 2}) //设置超时,单位毫秒
.then(function(res){
console.log(res);
}).catch((error) => {
console.log('error')
})