示例代碼
// axios建立執行個體對象來發起請求
const fun = axios.create({
baseURL: 'https://api.apiopen.top'
});
fun({
url: 'getJoke'
}).then(response => console.log(response));
// axios建立執行個體對象來發起請求
const fun = axios.create({
baseURL: 'https://api.apiopen.top'
});
fun({
url: 'getJoke'
}).then(response => console.log(response));