axiosの基本(4):axiosは、リクエストを送信するためのインスタンスオブジェクトを作成します

サンプルコード

// axios创建实例对象来发起请求
const fun = axios.create({
    
    
    baseURL: 'https://api.apiopen.top'
});

fun({
    
    
    url: 'getJoke'
}).then(response => console.log(response));

おすすめ

転載: blog.csdn.net/sinat_41696687/article/details/114876513