mirror of
https://github.com/d-fi/d-fi-core.git
synced 2025-07-21 04:35:01 +02:00
update request instance
This commit is contained in:
parent
7f3dbfbd21
commit
268b317201
@ -7,7 +7,7 @@ const ARL =
|
|||||||
const instance = axios.create({
|
const instance = axios.create({
|
||||||
baseURL: 'https://api.deezer.com/1.0',
|
baseURL: 'https://api.deezer.com/1.0',
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
timeout: 10000,
|
timeout: 15000,
|
||||||
headers: {
|
headers: {
|
||||||
Accept: '*/*',
|
Accept: '*/*',
|
||||||
'Accept-Encoding': 'gzip, deflate',
|
'Accept-Encoding': 'gzip, deflate',
|
||||||
@ -51,8 +51,8 @@ instance.interceptors.response.use(async (response) => {
|
|||||||
if (response.data.error.NEED_API_AUTH_REQUIRED) {
|
if (response.data.error.NEED_API_AUTH_REQUIRED) {
|
||||||
await initDeezerApi(ARL);
|
await initDeezerApi(ARL);
|
||||||
return await instance(response.config);
|
return await instance(response.config);
|
||||||
} else if (response.data.error.code == 4) {
|
} else if (response.data.error.code === 4) {
|
||||||
await delay(1000);
|
await delay.range(1000, 1500);
|
||||||
return await instance(response.config);
|
return await instance(response.config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user