- Cataloghi: pagine, schede, formato
This commit is contained in:
@@ -180,16 +180,19 @@ export const Api = {
|
||||
|
||||
if (error.status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_TOKEN_EXPIRED) {
|
||||
try {
|
||||
console.log('Token Scaduto.')
|
||||
const newAccessToken = await this.refreshToken();
|
||||
if (newAccessToken) {
|
||||
userStore.setAuth(newAccessToken, userStore.refreshToken);
|
||||
if (!evitaloop)
|
||||
if (!evitaloop) {
|
||||
console.log('uso il RefreshToken...')
|
||||
return resolve(this.SendReq(url, method, mydata, setAuthToken, true));
|
||||
}
|
||||
} else {
|
||||
$router.push('/signin')
|
||||
}
|
||||
} catch (err2: any) {
|
||||
console.error('err2', err2)
|
||||
console.error('err2, Token Invalido', err2)
|
||||
if (err2?.code === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN) {
|
||||
userStore.setServerCode(toolsext.ERR_AUTHENTICATION)
|
||||
userStore.setAuth('', '')
|
||||
@@ -241,7 +244,7 @@ export const Api = {
|
||||
mydata: any,
|
||||
setAuthToken = false,
|
||||
evitaloop = false,
|
||||
retryCount = 5,
|
||||
retryCount = 3,
|
||||
retryDelay = 5000
|
||||
): Promise<Types.AxiosSuccess | Types.AxiosError> {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user