- sendcoins
- font - catalogo
This commit is contained in:
@@ -92,7 +92,8 @@ export const Api = {
|
||||
const refrTok = localStorage.getItem(toolsext.localStorage.refreshToken);
|
||||
|
||||
if (!refrTok || refrTok === 'undefined') {
|
||||
throw new Error('Refresh token non disponibile');
|
||||
//throw new Error('Refresh token non disponibile');
|
||||
return false;
|
||||
}
|
||||
|
||||
const response = await sendRequest('/users/newtok', 'POST', { refreshToken: refrTok });
|
||||
@@ -145,14 +146,16 @@ export const Api = {
|
||||
} catch (err2) {
|
||||
console.error('Errore durante il refresh token:', err2);
|
||||
|
||||
if (err2?.code === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN) {
|
||||
let mystatus = err2?.code || err2?.status
|
||||
|
||||
if (mystatus === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN || mystatus === toolsext.ERR_RETRY_LOGIN) {
|
||||
userStore.setServerCode(toolsext.ERR_AUTHENTICATION);
|
||||
userStore.setAuth('', '');
|
||||
throw { status: err2.code };
|
||||
throw { status: toolsext.ERR_RETRY_LOGIN };
|
||||
}
|
||||
|
||||
// Gestione di altri errori critici
|
||||
throw err2;
|
||||
throw err2 || {status: serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN} ;
|
||||
}
|
||||
} else if (status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN) {
|
||||
userStore.setAuth('', '');
|
||||
|
||||
@@ -516,4 +516,9 @@ export const costanti = {
|
||||
TESTO_BORDATO: 5,
|
||||
},
|
||||
|
||||
CATALOGHI: {
|
||||
PAG_INTRO_DEFAULT: 'introduttiva_default.png',
|
||||
PAG_SFONDO_DEFAULT: 'sfondo_default.png',
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -965,7 +965,7 @@ export const colmyMovement = [
|
||||
link: '/grp/groupfrom.groupname',
|
||||
noshowlabel: true,
|
||||
extrafield: 'movement.fromCColl',
|
||||
tipoconto: shared_consts.AccountType.COLLECTIVE_ACCOUNT,
|
||||
tipoconto: shared_consts.AccountType.CONTO_DI_GRUPPO,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'contocomfrom.path',
|
||||
@@ -1005,7 +1005,7 @@ export const colmyMovement = [
|
||||
link: '/grp/groupto.groupname',
|
||||
extrafield: 'movement.toCColl',
|
||||
noshowlabel: true,
|
||||
tipoconto: shared_consts.AccountType.COLLECTIVE_ACCOUNT,
|
||||
tipoconto: shared_consts.AccountType.CONTO_DI_GRUPPO,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'contocomfto.path',
|
||||
@@ -1052,7 +1052,7 @@ export const colmyMovementTable = [
|
||||
tipovisu: costanti.TipoVisu.LINK,
|
||||
fieldtype: costanti.FieldType.username_chip,
|
||||
link: '/grp/groupfrom.groupname',
|
||||
tipoconto: shared_consts.AccountType.COLLECTIVE_ACCOUNT,
|
||||
tipoconto: shared_consts.AccountType.CONTO_DI_GRUPPO,
|
||||
required: true,
|
||||
}),
|
||||
AddCol({
|
||||
@@ -1089,7 +1089,7 @@ export const colmyMovementTable = [
|
||||
tipovisu: costanti.TipoVisu.LINK,
|
||||
fieldtype: costanti.FieldType.username_chip,
|
||||
link: '/grp/groupto.groupname',
|
||||
tipoconto: shared_consts.AccountType.COLLECTIVE_ACCOUNT,
|
||||
tipoconto: shared_consts.AccountType.CONTO_DI_GRUPPO,
|
||||
required: true,
|
||||
}),
|
||||
AddCol({
|
||||
@@ -4047,7 +4047,7 @@ export const colmyUserCircuit = [
|
||||
fieldtype: costanti.FieldType.username_chip,
|
||||
link: '/circuit/groupname',
|
||||
noshowlabel: true,
|
||||
tipoconto: shared_consts.AccountType.COLLECTIVE_ACCOUNT,
|
||||
tipoconto: shared_consts.AccountType.CONTO_DI_GRUPPO,
|
||||
}),
|
||||
|
||||
AddCol({ name: 'deperibile', label_trans: 'account.deperibile', fieldtype: costanti.FieldType.boolean }),
|
||||
@@ -4093,7 +4093,7 @@ export const colTableNotifCoins = [
|
||||
fieldtype: costanti.FieldType.username_chip,
|
||||
link: '/grp/extrarec.groupdest',
|
||||
noshowlabel: true,
|
||||
tipoconto: shared_consts.AccountType.COLLECTIVE_ACCOUNT,
|
||||
tipoconto: shared_consts.AccountType.CONTO_DI_GRUPPO,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'extrarec.contoComDest',
|
||||
|
||||
@@ -9395,7 +9395,7 @@ export const tools = {
|
||||
}
|
||||
if (mov.groupfrom) {
|
||||
mystrfrom += mov.groupfrom.groupname + ' '
|
||||
tipocontofrom = shared_consts.AccountType.COLLECTIVE_ACCOUNT
|
||||
tipocontofrom = shared_consts.AccountType.CONTO_DI_GRUPPO
|
||||
}
|
||||
if (mov.userfrom) {
|
||||
mystrfrom += mov.userfrom.username + ' '
|
||||
@@ -9407,7 +9407,7 @@ export const tools = {
|
||||
}
|
||||
if (mov.groupto) {
|
||||
mystrto += mov.groupto.groupname + ' '
|
||||
tipocontoto = shared_consts.AccountType.COLLECTIVE_ACCOUNT
|
||||
tipocontoto = shared_consts.AccountType.CONTO_DI_GRUPPO
|
||||
}
|
||||
if (mov.userto) {
|
||||
mystrto += mov.userto.username + ' '
|
||||
|
||||
@@ -152,13 +152,18 @@ export const useProducts = defineStore('Products', {
|
||||
getCatProdsStrByCatProds: (state: IProductsState) => (catProds: ICatProd[]): string => {
|
||||
let mystr = ''
|
||||
for (const catprod of catProds) {
|
||||
const myarrcat = state.catprods.find((rec: ICatProd) => rec._id === catprod)
|
||||
let myarrcat = null
|
||||
if (tools.isObject(catprod)) {
|
||||
myarrcat = catprod
|
||||
} else {
|
||||
myarrcat = state.catprods.find((rec: ICatProd) => rec._id === catprod)
|
||||
}
|
||||
if (myarrcat) {
|
||||
if (mystr)
|
||||
mystr = ' - '
|
||||
mystr += myarrcat.name
|
||||
}
|
||||
}
|
||||
}
|
||||
return mystr
|
||||
},
|
||||
|
||||
@@ -1427,6 +1432,8 @@ export const useProducts = defineStore('Products', {
|
||||
const misure = myproduct.arrvariazioni![0].misure || ''
|
||||
const formato = myproduct.arrvariazioni![0].formato || ''
|
||||
const pagine = myproduct.arrvariazioni![0].pagine || ''
|
||||
const qta = myproduct.arrvariazioni![0].quantita || ''
|
||||
const isbn = myproduct.productInfo.code || ''
|
||||
|
||||
const scale = optcatalogo.printable ? optcatalogo.areadistampa?.scale : 1
|
||||
// Crea una mappa di sostituzioni
|
||||
@@ -1442,7 +1449,9 @@ export const useProducts = defineStore('Products', {
|
||||
'{sottocategoria}': (sottocategoria) || '',
|
||||
'{descr_categoria}': (descr_categoria) || '',
|
||||
'{pagine}': (pagine) || '',
|
||||
'{isbn}': (isbn) || '',
|
||||
'{misure}': misure || '',
|
||||
'{argomento}': categoria || '',
|
||||
'{date_pub}': date_pub || '',
|
||||
'{ranking_globale}': ranking_globale || '',
|
||||
'{ranking}': ranking || '',
|
||||
@@ -1455,6 +1464,7 @@ export const useProducts = defineStore('Products', {
|
||||
'{descrizione_completa_macro}': descrizione_completa_macro || '',
|
||||
'{descrizione_breve_macro}': descrizione_breve_macro || '',
|
||||
'{link_macro}': link_macro || '',
|
||||
'{qta}': qta || '',
|
||||
};
|
||||
|
||||
// Esegue le sostituzioni
|
||||
|
||||
@@ -441,7 +441,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
let img = ''
|
||||
if (tipoconto === shared_consts.AccountType.USER) {
|
||||
img = this.getImgByUsername(value)
|
||||
} else if (tipoconto === shared_consts.AccountType.COLLECTIVE_ACCOUNT) {
|
||||
} else if (tipoconto === shared_consts.AccountType.CONTO_DI_GRUPPO) {
|
||||
img = this.getImgByGroupname(value)
|
||||
} else if (tipoconto === shared_consts.AccountType.COMMUNITY_ACCOUNT) {
|
||||
img = this.getImgByCircuitpath(value)
|
||||
@@ -469,7 +469,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
tipoconto = col.tipoconto
|
||||
}
|
||||
|
||||
if (tipoconto === shared_consts.AccountType.COLLECTIVE_ACCOUNT) {
|
||||
if (tipoconto === shared_consts.AccountType.CONTO_DI_GRUPPO) {
|
||||
img = this.getImgByGroupname(myrec.groupname)
|
||||
} else if (tipoconto === shared_consts.AccountType.COMMUNITY_ACCOUNT) {
|
||||
img = this.getImgByCircuitpath(myrec.path)
|
||||
@@ -496,7 +496,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
if (!reale)
|
||||
img = '/images/noimg-user.svg'
|
||||
|
||||
if (tipoconto === shared_consts.AccountType.COLLECTIVE_ACCOUNT) {
|
||||
if (tipoconto === shared_consts.AccountType.CONTO_DI_GRUPPO) {
|
||||
img = this.getImgByGroup(from ? mov.groupfrom : mov.groupto)
|
||||
// img = this.getImgByGroupname(from ? mov.groupfrom.groupname : mov.groupto.groupname)
|
||||
} else if (tipoconto === shared_consts.AccountType.COMMUNITY_ACCOUNT) {
|
||||
@@ -802,7 +802,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
if (col && col.field === 'extrarec' && !name) {
|
||||
name = myrec.dest
|
||||
}
|
||||
} else if (tipoconto === shared_consts.AccountType.COLLECTIVE_ACCOUNT) {
|
||||
} else if (tipoconto === shared_consts.AccountType.CONTO_DI_GRUPPO) {
|
||||
if (tools.existProp(myrec, 'descr'))
|
||||
return myrec.descr
|
||||
else if (tools.existProp(myrec, 'groupname'))
|
||||
|
||||
Reference in New Issue
Block a user