自己封装的一个类似axios的请求

下载:https://pan.baidu.com/s/1mOlHHstoDt9v_OY3CraElA

使用:

    axios({
      method:'post',
      baseURL:baseAddress,
      url:'img_add.ashx',
      data:options
    }).then(function(res){
    let data = res.data;
      if(data.res == "1"){
        resolve(data.data);
      }else{
        reject(data.msg);
      }
    }).catch(function(message){
      reject(message);
    });

猜你喜欢

转载自www.cnblogs.com/mrzhu/p/9694765.html