axios基础(四):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