天天看點

axios基礎(四):axios建立執行個體對象發送請求

示例代碼

// axios建立執行個體對象來發起請求
const fun = axios.create({
    baseURL: 'https://api.apiopen.top'
});

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