mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
fix auto refresh (disable cache)
This commit is contained in:
@@ -9,7 +9,7 @@ export const ACCESS_TOKEN = 'access_token';
|
|||||||
export const alovaInstance = createAlova({
|
export const alovaInstance = createAlova({
|
||||||
statesHook: ReactHook,
|
statesHook: ReactHook,
|
||||||
// timeout: 3000, // 3 seconds before throwing a timeout error, default is 0 = none
|
// timeout: 3000, // 3 seconds before throwing a timeout error, default is 0 = none
|
||||||
// cacheFor: null, // disable cache
|
cacheFor: null, // disable cache
|
||||||
// cacheFor: {
|
// cacheFor: {
|
||||||
// GET: {
|
// GET: {
|
||||||
// mode: 'memory',
|
// mode: 'memory',
|
||||||
@@ -22,7 +22,7 @@ export const alovaInstance = createAlova({
|
|||||||
method.config.headers.Authorization =
|
method.config.headers.Authorization =
|
||||||
'Bearer ' + localStorage.getItem(ACCESS_TOKEN);
|
'Bearer ' + localStorage.getItem(ACCESS_TOKEN);
|
||||||
}
|
}
|
||||||
// for simulating vrey slow networks
|
// for simulating very slow networks
|
||||||
// return new Promise((resolve) => {
|
// return new Promise((resolve) => {
|
||||||
// const random = 3000 + Math.random() * 2000;
|
// const random = 3000 + Math.random() * 2000;
|
||||||
// setTimeout(resolve, Math.floor(random));
|
// setTimeout(resolve, Math.floor(random));
|
||||||
|
|||||||
Reference in New Issue
Block a user