- Caricamento Video
This commit is contained in:
@@ -145,7 +145,17 @@ async function Request(
|
||||
|
||||
// ✅ AGGIUNGI IL TIMEOUT DALLE OPTIONS
|
||||
if (options?.timeout) {
|
||||
config.timeout = options.timeout; // in millisecondi (es. 300000 = 5 minuti)
|
||||
config.timeout = options.timeout;
|
||||
}
|
||||
|
||||
// ✅ AGGIUNGI SUPPORTO PER onUploadProgress
|
||||
if (options?.onUploadProgress) {
|
||||
config.onUploadProgress = options.onUploadProgress;
|
||||
}
|
||||
|
||||
// ✅ AGGIUNGI SUPPORTO PER onDownloadProgress (opzionale)
|
||||
if (options?.onDownloadProgress) {
|
||||
config.onDownloadProgress = options.onDownloadProgress;
|
||||
}
|
||||
|
||||
if (options?.stream) config.responseType = 'stream';
|
||||
@@ -210,7 +220,6 @@ async function Request(
|
||||
},
|
||||
...responsedata,
|
||||
});*/
|
||||
|
||||
} else if (type === 'postFormData') {
|
||||
response = await axiosInstance.post(path, payload, config);
|
||||
} else {
|
||||
@@ -221,11 +230,9 @@ async function Request(
|
||||
// Gestione aggiornamento token se necessario
|
||||
//const setAuthToken = path === '/updatepwd' || path === '/users/login';
|
||||
const setAuthToken = !!x_auth_token;
|
||||
if (
|
||||
response && setAuthToken
|
||||
) {
|
||||
if (response && setAuthToken) {
|
||||
const refreshToken = String(response.headers['x-refrtok'] || '');
|
||||
const browser_random = userStore.getBrowserRandom()
|
||||
const browser_random = userStore.getBrowserRandom();
|
||||
if (!x_auth_token) {
|
||||
userStore.setServerCode(toolsext.ERR_AUTHENTICATION);
|
||||
}
|
||||
@@ -237,7 +244,7 @@ async function Request(
|
||||
userStore.setAuth(x_auth_token, refreshToken, browser_random);
|
||||
localStorage.setItem(toolsext.localStorage.token, x_auth_token);
|
||||
localStorage.setItem(toolsext.localStorage.refreshToken, refreshToken);
|
||||
localStorage.setItem(toolsext.localStorage. browser_random, browser_random);
|
||||
localStorage.setItem(toolsext.localStorage.browser_random, browser_random);
|
||||
}
|
||||
|
||||
globalStore.setStateConnection('online');
|
||||
@@ -245,7 +252,7 @@ async function Request(
|
||||
return new Types.AxiosSuccess(response.data, response.status);
|
||||
} catch (error) {
|
||||
// Aggiornamento asincrono dello stato di connessione (setTimeout per dare tempo a eventuali animazioni)
|
||||
console.error('Errore funzione Request', error)
|
||||
console.error('Errore funzione Request', error);
|
||||
setTimeout(() => {
|
||||
if (['get'].includes(type.toLowerCase())) {
|
||||
globalStore.connData.downloading_server =
|
||||
|
||||
Reference in New Issue
Block a user