2021.11.23

<script>
        /*
          then response
          then data
        */
        fetch('./00 data.json',{})
            .then(function (response) {
                // resole
                console.log(response)
                return response.json();
            })
            .then(function (data) {
                console.log(data);
            })
            .catch(function(){
                // reject
            })
    </script>
 
 /*
          参数 params
          数据 .data
        */
         axios.get("./00 data.json",{
            //  Headers:{

            //  }
             params:{
                 id:1001
             }
         })
         .then(function(response){
             console.log(response.data)
         })
         .catch(function(err){
             console.log(err);
         })
posted on 2021-11-24 08:21  闲鱼仔  阅读(25)  评论(0)    收藏  举报