Gestione Refresh Token Completata !

This commit is contained in:
Surya Paolo
2024-04-11 11:43:38 +02:00
parent 62c0f497e5
commit bff31b5fd4
93 changed files with 3592683 additions and 214 deletions

View File

@@ -1,6 +1,6 @@
APP_VERSION="1.0.33"
APP_VERSION="1.0.34"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="17"
APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet"
DIRECTORY_SERVER="freeplanet_serverside"
SERVERDIR_WEBSITE=""
@@ -12,7 +12,7 @@ LANG_DEFAULT="it"
PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF"
MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T"
MONGODB_HOST="https://localhost:3000"
LOGO_REG='piuchebuono-logo-full.png'
LOGO_REG='riso-logo-full.png'
TEST_NAME="Paolo"
TEST_SURNAME="Arena"
TEST_EMAIL=""

View File

@@ -1,4 +1,4 @@
APP_VERSION="1.0.33"
APP_VERSION="1.0.34"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="1.0.33"
APP_VERSION="1.0.34"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="17"
DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="1.0.33"
APP_VERSION="1.0.34"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="17"
DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="1.0.33"
APP_VERSION="1.0.34"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="1.0.33"
APP_VERSION="1.0.34"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="1.0.33"
APP_VERSION="1.0.34"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="15"
DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="1.0.33"
APP_VERSION="1.0.34"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="15"
DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="1.0.33"
APP_VERSION="1.0.34"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="1.0.33"
APP_VERSION="1.0.34"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="17"
DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="1.0.33"
APP_VERSION="1.0.34"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="1.0.33"
APP_VERSION="1.0.34"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="1.0.33"
APP_VERSION="1.0.34"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="1.0.33"
APP_VERSION="1.0.34"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="16"
DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="1.0.33"
APP_VERSION="1.0.34"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="14"
DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1 +1 @@
TERMINA DI LAVORARE SU riso.app: (Sovrascrivo !)
TERMINA DI LAVORARE SU piuchebuono.app: (Sovrascrivo !)

View File

@@ -1,8 +1,8 @@
{
"name": "piuchebuono",
"version": "2.0.1",
"description": "PiuCheBuono",
"productName": "PiuCheBuono",
"name": "riso",
"version": "0.6.1",
"description": "Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.",
"productName": "Riso",
"author": "Paolo Arena",
"private": true,
"keywords": [],
@@ -43,7 +43,6 @@
"bcryptjs": "^2.4.3",
"chart.js": "^4.4.2",
"core-js": "^3.36.1",
"crypto": "^1.0.1",
"crypto-browserify": "^3.12.0",
"date-fns": "^3.6.0",
"dotenv": "^16.4.5",

File diff suppressed because it is too large Load Diff

BIN
public/images/ferrara.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
public/images/foto1.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 12 KiB

BIN
public/images/foto2.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 12 KiB

BIN
public/images/foto3.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 12 KiB

BIN
public/images/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 618 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 KiB

BIN
public/images/riso_home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

View File

@@ -68,6 +68,7 @@ module.exports = configure((ctx) => ({
views: path.resolve(__dirname, 'src/views/index.ts'),
icons: path.resolve(__dirname, 'src/assets/icons'),
images: path.resolve(__dirname, 'src/assets/images'),
maps: path.resolve(__dirname, 'src/public/maps'),
classes: path.resolve(__dirname, 'src/classes/index.ts'),
fonts: path.resolve(__dirname, 'src/assets/fonts'),
utils: path.resolve(__dirname, 'src/utils/index.ts'),
@@ -94,7 +95,6 @@ module.exports = configure((ctx) => ({
transpileDependencies: [
/quasar-ui-qcalendar[\\/]src/
],
devtool: 'source-map',
chainWebpack(chain, { isServer, isClient }) {
chain.resolve.alias
@@ -108,6 +108,7 @@ module.exports = configure((ctx) => ({
.set('@css', path.resolve(__dirname, 'src/public/css/variables.scss'))
.set('@icons', path.resolve(__dirname, 'src/public/icons/*'))
.set('@images', path.resolve(__dirname, 'src/public/images/*'))
.set('@maps', path.resolve(__dirname, 'src/public/maps/*'))
.set('@classes', path.resolve(__dirname, 'src/classes/index.ts'))
.set('@utils', path.resolve(__dirname, 'src/utils/index.ts'))
.set('@utils', path.resolve(__dirname, 'src/utils/*'))
@@ -148,8 +149,9 @@ module.exports = configure((ctx) => ({
},
devServer: {
https: false,
port: 8088,
port: 8084,
open: false, // opens browser window automatically
hot: false, // Disable hot module replacement
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers': '*',
@@ -295,8 +297,8 @@ module.exports = configure((ctx) => ({
workboxPluginMode: 'InjectManifest', // 'GenerateSW' or 'InjectManifest'
workboxOptions: {}, // only for GenerateSW
extendGenerateSWOptions(cfg) {
cfg.skipWaiting = true
cfg.clientsClaim = true
cfg.skipWaiting = false
cfg.clientsClaim = false
},
// for the custom service worker ONLY (/src-pwa/custom-service-worker.[js|ts])
// if using workbox in InjectManifest mode
@@ -306,9 +308,9 @@ module.exports = configure((ctx) => ({
},
manifest: {
name: 'Più che Buono',
short_name: 'PiuCheBuono',
description: 'PiuCheBuono è un GAS e Bottega',
name: 'Riso',
short_name: 'Riso',
description: 'Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.',
display: 'standalone',
orientation: 'portrait',
background_color: '#fff',
@@ -318,54 +320,54 @@ module.exports = configure((ctx) => ({
start_url: "/?homescreen=1",
icons: [
{
src: 'images/pcb-android-icon-512x512.png',
src: 'images/riso-android-icon-512x512.png',
sizes: '512x512',
type: 'image/png',
},
{
src: 'images/pcb-android-icon-384x384.png',
src: 'images/riso-android-icon-384x384.png',
sizes: '384x384',
type: 'image/png',
},
{
src: 'images/pcb-android-icon-192x192.png',
src: 'images/riso-android-icon-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: 'images/pcb-android-icon-144x144.png',
src: 'images/riso-android-icon-144x144.png',
sizes: '144x144',
type: 'image/png',
},
{
src: 'images/pcb-android-icon-96x96.png',
src: 'images/riso-android-icon-96x96.png',
sizes: '96x96',
type: 'image/png',
},
{
src: 'images/pcb-apple-icon-120x120.png',
src: 'images/riso-apple-icon-120x120.png',
sizes: '120x120',
type: 'image/png',
},
{
src: 'images/pcb-apple-icon-144x144.png',
src: 'images/riso-apple-icon-144x144.png',
sizes: '144x144',
type: 'image/png',
},
{
src: 'images/pcb-apple-icon-152x152.png',
src: 'images/riso-apple-icon-152x152.png',
sizes: '152x152',
type: 'image/png',
},
{
src: 'images/pcb-apple-icon-180x180.png',
src: 'images/riso-apple-icon-180x180.png',
sizes: '180x180',
type: 'image/png',
},
],
related_applications: [{
"platform": "webapp",
"url": "https://www.piuchebuono.app/manifest.json"
"url": "https://www.riso.app/manifest.json"
}]
},
},
@@ -400,7 +402,7 @@ module.exports = configure((ctx) => ({
builder: {
// https://www.electron.build/configuration/configuration
appId: 'PiuCheBuono',
appId: 'Riso',
},
// "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain

View File

@@ -478,7 +478,7 @@ self.addEventListener('sync', function (event) {
headers.append('content-Type', 'application/json')
headers.append('Accept', 'application/json')
headers.append('x-auth', token)
headers.append('x-refrTok', refreshToken)
headers.append('x-refrtok', refreshToken)
// console.log('A1) INIZIO.............................................................');

View File

@@ -2,6 +2,43 @@
<div v-if="showalways || (!showalways && !tools.isLogged())">
<div class="q-pa-md q-gutter-sm">
<div class=" text-center">
<transition-group
name="fade"
mode="out-in"
appear
enter-active-class="animazione fadeIn"
leave-active-class="animazione fadeOut"
>
<q-banner
:key="1"
rounded
class="text-white bg-red"
color="primary q-title"
style="text-align: center"
>
<template v-slot:avatar>
<q-icon :key="2" name="fas fa-sign-in-alt" color="white" />
</template>
<div :key="3">
Accedi con le tue credenziali per utilizzare la APP e per unirti
al Circuito di scambio RIS del tuo territorio
</div>
<template v-slot:action>
<div>
<q-btn
flat
color="white"
@click="tools.openrighttoolbar()"
>{{ $t('login.enter') }}
</q-btn>
</div>
<!--<CRegistration />-->
</template>
</q-banner>
</transition-group>
<q-separator inset />
<br>
<q-banner
v-if="false"
rounded

View File

@@ -205,8 +205,8 @@ export default defineComponent({
}
function mounted() {
console.log('mounted elem ')
console.log(props.myelem.type)
//console.log('mounted elem ')
//console.log(props.myelem.type)
myel.value = props.myelem
neworder.value = props.myelem.order

View File

@@ -95,7 +95,7 @@ export default defineComponent({
if (mypathin.value !== '') {
globalStore.loadPage('/' + mypathin.value, 'cmypageelem').then(ris => {
rec.value = ris
console.log('LoadPage', ris)
// console.log('LoadPage', ris)
})
}

View File

@@ -8,8 +8,6 @@ const msg_website_enUs = {
products: {
quantity: 'Quantità',
quantityAvailable: 'Disponibili',
stockQty: 'In Magazzino',
stockBloccatiQty: 'Bloccati In Magazzino',
weight: 'Peso',
stars: 'Voto',
color: 'Colore',
@@ -38,7 +36,6 @@ const msg_website_enUs = {
productslist: 'Lista Prodotti',
collabora: 'Collabora',
storehouses: 'Magazzino',
providers: 'Fornitori',
departments: 'Uffici',
orders: 'Ordini Ricevuti',
orders2: 'Ordini Ricevuti',

View File

@@ -8,7 +8,6 @@ const msg_website_es = {
products: {
quantity: 'Quantità',
quantityAvailable: 'Disponibili',
stockQty: 'In Magazzino',
weight: 'Peso',
stars: 'Voto',
color: 'Colore',

View File

@@ -1,9 +1,9 @@
const msg_website_it = {
ws: {
sitename: 'Più che Buono',
siteshortname: 'Più che Buono',
description: '',
keywords: '',
sitename: 'Riso',
siteshortname: 'RISO',
description: 'Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.',
keywords: 'riso, piattaforma di scambio, rete italiana scambio orizzontale, riso app, riso piattaforma, scambio e baratto, momenta RIS',
},
hours: {
descr: 'Descrizione',
@@ -16,35 +16,23 @@ const msg_website_it = {
pages: {
home: 'Home',
profile: 'Profilo',
install_site: 'Installa Sito',
profile2: 'ProfiloU',
mypage2: 'mypage2',
myservice2: 'myservice2',
myhosps2: 'myhosps2',
mygood2: 'mygood2',
catalogo: 'Catalogo',
fundraising: 'Sostieni il Progetto',
notifs: 'Configura le Notifiche',
unsubscribe: 'Disiscriviti',
unsubscribe_user: 'Disiscriviti User',
test: 'Test',
projects: 'Progetti',
report: 'Report Ore',
producer: 'Produttore',
orderinfo: 'Ordini Effettuati',
products: 'Prodotti',
cash: 'Cassa',
productInfos: 'Info Prodotti',
listinoprodotti: 'Listino Prodotti',
productslist: 'Lista Prodotti',
collabora: 'Collabora',
categories: 'Categorie',
storehouses: 'Magazzino',
providers: 'Fornitori',
catprods: 'Categorie',
subcatprods: 'Sotto-Categorie',
gasordine: 'Gas Ordine',
scontisticas: 'Scontistica',
departments: 'Uffici',
orders: 'Ordini Ricevuti',
orders2: 'Ordini Ricevuti',
@@ -133,11 +121,9 @@ const msg_website_it = {
only_residenti: 'Solo Residenti',
only_consiglio: 'Solo Consiglieri',
color: 'Colore',
gasordini: 'Gas Ordini',
gestoreordini: 'Gestore Ordini',
},
msg: {
myAppName: 'Più che Buono',
myAppName: 'Riso',
myAppDescription: 'Il primo Vero Social Libero, Equo e Solidale, dove Vive Consapevolezza e Aiuto Comunitario. Gratuito',
underconstruction: 'App in costruzione...',
myDescriz: '',

View File

@@ -7,6 +7,30 @@ import {
import { func } from '@store/Modules/fieldsTable'
// const SHOW_PROJINTHEMENU = false
//
// let arrlistafavourite = []
// let arrlistaprojtutti = []
// let arrlistaprojmiei = []
// if (SHOW_PROJINTHEMENU) {
// arrlistaprojtutti = Projects.getters.listaprojects(RouteNames.projectsall)
// arrlistaprojmiei = Projects.getters.listaprojects(RouteNames.myprojects)
// arrlistafavourite = Projects.getters.listaprojects(RouteNames.favouriteprojects)
// }
// PROGETTI -> FAVORITI :
// if (arrlistafavourite.length > 0) {
// arrMenu.push({
// icon: 'favorite_border',
// nametranslate: 'pages.' + RouteNames.favouriteprojects,
// urlroute: RouteNames.favouriteprojects,
// level_parent: 0.0,
// level_child: 0.5,
// routes2: arrlistafavourite,
// idelem: ''
// })
// }
const firstPage = {
active: true,
order: 5,
@@ -33,7 +57,72 @@ function getDynamicPages(site: ISites): IListRoutes[] {
inmenu: true,
infooter: true,
},
/*{
{
active: true,
order: 400,
path: '/test',
materialIcon: 'fas fa-test',
name: 'mypages.test',
component: () => import('@/views/testServer/testServer.vue'),
inmenu: false,
infooter: false,
},
{
active: true,
order: 12,
path: '/goods',
materialIcon: 'fas fa-tshirt',
name: 'mypages.goods',
component: () => import('@/root/goods/goods.vue'),
meta: { requiresAuth: true },
inmenu: true,
infooter: true,
},
{
active: true,
order: 15,
path: '/services',
materialIcon: 'fas fa-house-user',
name: 'mypages.services',
component: () => import('@/root/services/services.vue'),
meta: { requiresAuth: true },
inmenu: true,
infooter: true,
},
{
active: true,
order: 15,
path: '/provapao',
materialIcon: 'fas fa-house-user',
name: 'mypages.provapao',
component: () => import('@/root/provapao/provapao.vue'),
meta: { requiresAuth: true },
inmenu: false,
infooter: false,
},
{
active: true,
order: 15,
path: '/hosps',
materialIcon: 'fas fa-bed',
name: 'mypages.hosp',
component: () => import('@/root/hosp/hosp.vue'),
meta: { requiresAuth: true },
inmenu: true,
infooter: true,
},
{
active: site.confpages && site.confpages.enableCircuits,
order: 16,
path: '/circuits',
materialIcon: 'fas fa-coins',
name: 'mypages.circuits',
component: () => import('@/views/user/mycircuits/mycircuits.vue'),
meta: { requiresAuth: true },
inmenu: true,
infooter: true,
},
{
active: true,
order: 20,
path: '/events',
@@ -43,17 +132,6 @@ function getDynamicPages(site: ISites): IListRoutes[] {
meta: { requiresAuth: true },
inmenu: true,
infooter: true,
},*/
{
active: site.confpages && site.confpages.showProfile,
order: 120,
path: '/myprofile',
materialIcon: 'fas fa-user',
name: 'pages.profile',
component: () => import('@/views/user/myprofile/myprofile.vue'),
meta: { requiresAuth: true },
inmenu: true,
infooter: true,
},
{
active: true,
@@ -67,7 +145,18 @@ function getDynamicPages(site: ISites): IListRoutes[] {
infooter: false,
},
{
active: site.confpages && site.confpages.showProfile,
active: true,
order: 120,
path: '/myprofile',
materialIcon: 'fas fa-user',
name: 'pages.profile',
component: () => import('@/views/user/myprofile/myprofile.vue'),
meta: { requiresAuth: true },
inmenu: true,
infooter: true,
},
{
active: true,
order: 120,
path: '/editprofile',
materialIcon: 'fas fa-user',
@@ -78,7 +167,7 @@ function getDynamicPages(site: ISites): IListRoutes[] {
infooter: false,
},
{
active: site.confpages && site.confpages.showiscrittiMenu,
active: true,
order: 130,
path: '/friends',
materialIcon: 'fas fa-user-friends',
@@ -88,19 +177,6 @@ function getDynamicPages(site: ISites): IListRoutes[] {
inmenu: true,
infooter: true,
},
{
active: site.confpages && site.confpages.enableCircuits,
order: 16,
path: '/circuits',
materialIcon: 'fas fa-coins',
name: 'mypages.circuits',
component: () => import('@/views/user/mycircuits/mycircuits.vue'),
meta: { requiresAuth: true },
inmenu: true,
infooter: true,
onlyAdmin: true,
onlyManager: true,
},
{
active: site.confpages && site.confpages.enableGroups,
order: 132,
@@ -111,8 +187,6 @@ function getDynamicPages(site: ISites): IListRoutes[] {
meta: { requiresAuth: true },
inmenu: true,
infooter: false,
onlyAdmin: true,
onlyManager: true,
},
{
active: true,

View File

@@ -10,6 +10,7 @@ import { LandingFooter } from '@/components/LandingFooter'
import { CDashboard } from '@/components/CDashboard'
import { CChartMap } from '@src/components/CChartMap'
import { CUserNonVerif } from '@/components/CUserNonVerif'
import { CCheckIfIsLogged } from '@components'
import { CTitlePage } from '@/components/CTitlePage'
import { CVerifyEmail } from '@src/components/CVerifyEmail'
import { CVerifyTelegram } from '@src/components/CVerifyTelegram'
@@ -23,7 +24,9 @@ import { colmyBachecas } from '@store/Modules/fieldsTable'
export default defineComponent({
name: 'eventi',
components: { CSkill, CChartMap, CFinder, CVerifyEmail, CVerifyTelegram, CDashboard, CUserNonVerif, CTitlePage, LandingFooter },
components: { CSkill, CChartMap, CFinder, CVerifyEmail, CVerifyTelegram, CDashboard, CUserNonVerif, CTitlePage, LandingFooter,
CCheckIfIsLogged
},
setup() {
return {
colmyBachecas,

View File

@@ -16,6 +16,9 @@
</div>
</div>
<div v-else>
<CCheckIfIsLogged></CCheckIfIsLogged>
</div>
</q-page>

View File

@@ -12,19 +12,21 @@ import { CUserNonVerif } from '@/components/CUserNonVerif'
import { CTitlePage } from '@/components/CTitlePage'
// import { CMapsEsempio } from '@src/components/CMapsEsempio'
import { CVerifyEmail } from '@src/components/CVerifyEmail'
import { CCheckIfIsLogged } from '@components'
import { CNotifAtTop } from '@src/components/CNotifAtTop'
import { CVerifyTelegram } from '@src/components/CVerifyTelegram'
import { LandingFooter } from '@/components/LandingFooter'
import { useGlobalStore } from '@store/globalStore'
import { useUserStore } from '@store/UserStore'
import { static_data } from '@/db/static_data'
import MixinBase from '@/mixins/mixin-base'
import MixinUsers from '@/mixins/mixin-users'
export default defineComponent({
name: 'Goods',
components: { CSkill, CChartMap, CFinder,
CNotifAtTop, CVerifyEmail, CVerifyTelegram, CDashboard, CUserNonVerif, CTitlePage, LandingFooter },
CNotifAtTop, CVerifyEmail, CVerifyTelegram, CDashboard, CUserNonVerif, CTitlePage, LandingFooter, CCheckIfIsLogged },
setup() {
return {

View File

@@ -1,28 +1,25 @@
<template>
<q-page class="">
<q-page class>
<div v-if="tools.isLogged()">
<CNotifAtTop />
<div v-if="tools.isUserOk()">
<CFinder
:ind="tools.getIndMainCardsByTable(toolsext.TABMYGOODS)"
:table="toolsext.TABMYGOODS"
/>
</div>
<div v-else>
<CUserNonVerif></CUserNonVerif>
</div>
</div>
<div v-else>
<CCheckIfIsLogged></CCheckIfIsLogged>
</div>
</q-page>
</template>
<script lang="ts" src="./goods.ts">
</script>
<style lang="scss" scoped>
@import './goods.scss';
@import "./goods.scss";
</style>

View File

@@ -21,10 +21,11 @@ import { static_data } from '@/db/static_data'
import MixinBase from '@/mixins/mixin-base'
import MixinUsers from '@/mixins/mixin-users'
import { costanti } from '@costanti'
import { CCheckIfIsLogged } from '@components'
export default defineComponent({
name: 'Services',
components: { CSkill, CChartMap, CNotifAtTop, CFinder, CVerifyEmail, CVerifyTelegram, CDashboard, CUserNonVerif, CTitlePage, LandingFooter },
components: { CSkill, CChartMap, CNotifAtTop, CFinder, CVerifyEmail, CVerifyTelegram, CDashboard, CUserNonVerif, CTitlePage, LandingFooter, CCheckIfIsLogged },
setup() {
return {
tools,

View File

@@ -18,6 +18,9 @@
</div>
</div>
<div v-else>
<CCheckIfIsLogged></CCheckIfIsLogged>
</div>
</q-page>

View File

@@ -435,10 +435,13 @@ export default defineComponent({
strris += addfield(col, 'unit', rec, {}); col++;
strris += addfield(col, 'link', rec, {}); col++;
strris += addfield(col, 'perc_iva', rec, {}); col++;
strris += addfield(col, 'price_acquistato', rec, { isnumero: true, iseuro: true }); col++;
strris += addfield(col, 'minBuyQty', rec, { isnumero: true }); col++;
strris += addfield(col, 'minStepQty', rec, { isnumero: true }); col++;
strris += addfield(col, 'sconto', rec, {}); col++;
strris += addfield(col, 'cat_name', rec, {}); col++;
strris += addfield(col, 'subcat_name', rec, {}); col++;

View File

@@ -63,14 +63,14 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
headers: {
'Content-Type': 'application/json',
'x-auth': userStore.x_auth_token,
'x-refrTok': userStore.refreshToken,
'x-refrtok': userStore.refreshToken,
},
})
ricevuto = true
// console.log('Request Response: ', response)
// console.log(new Types.AxiosSuccess(response.data, response.status))
const setAuthToken = (path === '/updatepwd')
const setAuthToken = (path === '/updatepwd') || (path === '/users/login')
// console.log('--------- 0 ')
@@ -80,7 +80,7 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
try {
if (setAuthToken || (path === '/users/login')) {
x_auth_token = String(response.headers['x-auth'])
refreshToken = String(response.headers['x-refrTok'])
refreshToken = String(response.headers['x-refrtok'])
if (x_auth_token === '') {
userStore.setServerCode(toolsext.ERR_AUTHENTICATION)
@@ -117,7 +117,7 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
headers: {
'Content-Type': 'application/json',
'x-auth': userStore.x_auth_token,
'x-refrTok': userStore.refreshToken,
'x-refrtok': userStore.refreshToken,
},
})
ricevuto = true
@@ -128,7 +128,7 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
headers: {
'Content-Type': 'multipart/form-data',
'x-auth': userStore.x_auth_token,
'x-refrTok': userStore.refreshToken,
'x-refrtok': userStore.refreshToken,
},
})
ricevuto = true

View File

@@ -18,6 +18,7 @@ import * as ApiTables from '@src/store/Modules/ApiTables'
import sendRequest from './Inst-Pao'
import Request from './Instance'
import globalroutines from '../../globalroutines/index'
import { useRouter } from 'vue-router'
function ReceiveResponsefromServer(tablesync: string, nametab: string, method: string, risdata: any) {
// console.log('ReceiveResponsefromServer', nametab, method, risdata)
@@ -92,32 +93,45 @@ export const Api = {
// Altrimenti, gestisci il caso di refreshToken scaduto o invalido, e.g., redirecting to login
try {
const userStore = useUserStore()
console.log('refreshToken')
const response = await axios.post('/users/newTok', {
refreshToken: localStorage.getItem(toolsext.localStorage.refreshToken)
});
const refrTok = localStorage.getItem(toolsext.localStorage.refreshToken)
let response = null
if (refrTok && refrTok !== 'undefined') {
// console.log('refreshToken=', refrTok)
response = await sendRequest('/users/newtok', 'POST', { refreshToken: refrTok })
if (response) {
// Save the new access token in local storage
localStorage.setItem(toolsext.localStorage.token, response.data.accessToken);
localStorage.setItem(toolsext.localStorage.token, response.data.token);
// Reset the refresh token if it was reset by the server
if (response.data.refreshToken) {
localStorage.setItem(toolsext.localStorage.refreshToken, response.data.refreshToken);
console.log('salva refreshtoken', response.data.refreshToken)
userStore.setRefreshToken(response.data.refreshToken)
}
// Return the new access token
return response.data.accessToken;
return response.data.token;
} else {
userStore.setAuth('', '')
localStorage.removeItem(toolsext.localStorage.token)
localStorage.removeItem(toolsext.localStorage.refreshToken)
}
}
} catch (error) {
// Handle the error, for example by logging out the user
console.error(error);
localStorage.removeItem(toolsext.localStorage.token);
localStorage.removeItem(toolsext.localStorage.refreshToken);
throw error;
console.error(error)
localStorage.removeItem(toolsext.localStorage.token)
localStorage.removeItem(toolsext.localStorage.refreshToken)
throw error
}
},
async SendReq(url: string, method: string, mydata: any, setAuthToken = false): Promise<Types.AxiosSuccess | Types.AxiosError> {
async SendReq(url: string, method: string, mydata: any, setAuthToken = false, evitaloop = false): Promise<Types.AxiosSuccess | Types.AxiosError> {
const mydataout = {
...mydata,
keyappid: process.env.PAO_APP_ID,
@@ -129,13 +143,13 @@ export const Api = {
const userStore = useUserStore()
const globalStore = useGlobalStore()
// const $router = useRouter()
const $router = useRouter()
userStore.setServerCode(tools.EMPTY)
userStore.setResStatus(0)
// eslint-disable-next-line @typescript-eslint/no-misused-promises
return new Promise((resolve, reject) => sendRequest(url, method, mydataout)
.then(async (res) => {
.then((res) => {
// console.log('status:', res.status)
setTimeout(() => {
@@ -156,28 +170,13 @@ export const Api = {
userStore.setAuth('', '')
// $router.push('/signin')
return reject({ code: toolsext.ERR_AUTHENTICATION })
} else if (res.status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_TOKEN_EXPIRED) {
console.log('Token Expired')
// Prova ad ottenere un nuovo token di accesso
try {
// Se il token è scaduto, allora faccio la richiesta di un NUOVO TOKEN, passandogli refreshToken
const newAccessToken = await this.refreshToken();
userStore.setAuth(newAccessToken, userStore.refreshToken);
// Riprova l'originale SendReq con il nuovo token.
// Assicurati di evitare un loop infinito in caso di errori continui
return resolve(this.SendReq(url, method, mydata, setAuthToken));
} catch (error) {
// Gestisci errore di refresh token (es. redirect a signin)
return reject(error);
}
}
}
if (tools.isDebug())
console.log(' ----> ', res)
return resolve(res)
})
.catch((error) => {
.catch(async (error) => {
setTimeout(() => {
if (method === 'get') {
globalStore.connData.downloading_server = -1
@@ -187,6 +186,37 @@ export const Api = {
}
}, 1000)
if (error.status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_TOKEN_EXPIRED) {
console.log('Token Expired')
// Prova ad ottenere un nuovo token di accesso
try {
// Se il token è scaduto, allora faccio la richiesta di un NUOVO TOKEN, passandogli refreshToken
const newAccessToken = await this.refreshToken();
if (newAccessToken) {
userStore.setAuth(newAccessToken, userStore.refreshToken);
// Riprova l'originale SendReq con il nuovo token.
// Assicurati di evitare un loop infinito in caso di errori continui
if (!evitaloop)
return resolve(this.SendReq(url, method, mydata, setAuthToken, true));
} else {
$router.push('/signin')
}
} catch (err2: any) {
// Gestisci errore di refresh token (es. redirect a signin)
console.error('err2', err2)
if (err2 && err2.hasOwnProperty('code') && err2.code === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN) {
// Forbidden
// You probably is connectiong with other page...
userStore.setServerCode(toolsext.ERR_AUTHENTICATION)
userStore.setAuth('', '')
return reject({ code: toolsext.ERR_AUTHENTICATION })
}
// return reject(err2);
}
}
console.log('ERROR', error)
return reject(error)
}))

View File

@@ -4396,7 +4396,7 @@ export const tools = {
},
getheaders() {
const userStore = useUserStore()
return [{ name: 'x-auth', value: userStore.x_auth_token }, { name: 'x-refrTok', value: userStore.refreshToken }]
return [{ name: 'x-auth', value: userStore.x_auth_token }, { name: 'x-refrtok', value: userStore.refreshToken }]
},
getextfile(filename: string) {

View File

@@ -1126,6 +1126,7 @@ export const useUserStore = defineStore('UserStore', {
},
updateLocalStorage(myuser: IUserFields) {
try {
const globalStore = useGlobalStore()
const now = tools.getDateNow()
@@ -1141,6 +1142,7 @@ export const useUserStore = defineStore('UserStore', {
if (myuser.profile !== undefined) tools.localStSetItem(toolsext.localStorage.img, (myuser.profile.img) ? String(myuser.profile.img) || '' : '')
else tools.localStSetItem(toolsext.localStorage.img, '')
localStorage.setItem(toolsext.localStorage.token, this.x_auth_token)
console.log('updateLocalStorage: salva refreshtoken', this.refreshToken)
localStorage.setItem(toolsext.localStorage.refreshToken, this.refreshToken)
localStorage.setItem(toolsext.localStorage.expirationDate, expirationDate.toString())
tools.localStSetItem(toolsext.localStorage.isLogged, String(true))
@@ -1149,6 +1151,9 @@ export const useUserStore = defineStore('UserStore', {
tools.localStSetItem(toolsext.localStorage.teleg_id, String(myuser.profile.teleg_id))
tools.localStSetItem(toolsext.localStorage.made_gift, String(myuser.made_gift))
tools.localStSetItem(toolsext.localStorage.wasAlreadySubOnDb, String(globalStore.wasAlreadySubOnDb))
} catch (e) {
console.error('updateLocalStorage', e)
}
},
setusersList(usersList: IUserFields[]) {
@@ -1244,9 +1249,15 @@ export const useUserStore = defineStore('UserStore', {
this.resStatus = status
},
setRefreshToken(refreshToken: string) {
this.refreshToken = refreshToken
localStorage.setItem(toolsext.localStorage.refreshToken, refreshToken)
console.log('setRefreshToken', refreshToken)
},
setAuth(x_auth_token: string, refreshToken: string) {
this.x_auth_token = x_auth_token
this.refreshToken = refreshToken
this.setRefreshToken(refreshToken)
},
resetArrToken(arrtokens: IToken[]) {
@@ -1434,7 +1445,7 @@ export const useUserStore = defineStore('UserStore', {
globalStore.setleftDrawerOpen(localStorage.getItem(toolsext.localStorage.leftDrawerOpen) === 'true')
globalStore.setCategorySel(localStorage.getItem(toolsext.localStorage.categorySel))
globalStore.checkUpdates()
await globalStore.checkUpdates()
}
const isok = await globalStore.loadAfterLogin()
@@ -1496,6 +1507,10 @@ export const useUserStore = defineStore('UserStore', {
isLogged = true
}
}
} else {
if (token) {
isLogged = true
}
}
} else {
isLogged = tools.isLogged()

View File

@@ -1646,6 +1646,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
this.rightDrawerOpen = true
return false
} else {
console.log('Sbianca cmq i dati')
// Sbianca cmq i dati
const token = localStorage.getItem(toolsext.localStorage.token)
if (token) {
@@ -1659,6 +1660,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
return true
}).then((res) => res).catch((error) => {
if (error.status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_TOKEN_EXPIRED) {
}
console.log('error dbLoad', error)
// userStore.setErrorCatch(error)
this.serverError = true

View File

@@ -1,4 +1,5 @@
import { CMyCircuits } from '@/components/CMyCircuits'
import { CCheckIfIsLogged } from '@components'
import { CFinder } from '@/components/CFinder'
import { CGridTableRec } from '@/components/CGridTableRec'
import { CNotifAtTop } from '@/components/CNotifAtTop'
@@ -15,7 +16,7 @@ import { shared_consts } from '@/common/shared_vuejs'
export default defineComponent({
name: 'mycircuits',
components: { CMyCircuits, CGridTableRec, CFinder, CNotifAtTop },
components: { CMyCircuits, CGridTableRec, CFinder, CNotifAtTop, CCheckIfIsLogged },
props: {},
setup() {
const userStore = useUserStore()

View File

@@ -1,13 +1,8 @@
<template>
<div v-if="isfinishLoading" class="">
<div v-if="isfinishLoading" class>
<div v-if="tools.isLogged()">
<CNotifAtTop />
<CMyCircuits
v-model="filter"
:finder="true"
:showfinder="true"
:showBarSelection="true"
>
<CMyCircuits v-model="filter" :finder="true" :showfinder="true" :showBarSelection="true">
<CFinder
:ind="tools.getIndMainCardsByTable(toolsext.TABCIRCUITS)"
:table="toolsext.TABCIRCUITS"
@@ -15,9 +10,11 @@
:showFilterPersonal="true"
:showBarSelection="true"
/>
</CMyCircuits>
</div>
<div v-else>
<CCheckIfIsLogged></CCheckIfIsLogged>
</div>
</div>
</template>
@@ -25,6 +22,6 @@
</script>
<style lang="scss" scoped>
@import './mycircuits.scss';
@import "./mycircuits.scss";
</style>

View File

@@ -8,6 +8,7 @@ import { computed, defineComponent, onMounted, ref, watch } from 'vue'
import { useUserStore } from '@store/UserStore'
import { useRoute, useRouter } from 'vue-router'
import { useGlobalStore } from '@store/globalStore'
import { CCheckIfIsLogged } from '@components'
import { useI18n } from '@/boot/i18n'
import { colmyUserGroup } from '@store/Modules/fieldsTable'
import { costanti } from '@costanti'
@@ -15,7 +16,7 @@ import { shared_consts } from '@/common/shared_vuejs'
export default defineComponent({
name: 'mygroups',
components: { CMyGroups, CGridTableRec, CNotifAtTop, CFinder },
components: { CMyGroups, CGridTableRec, CNotifAtTop, CFinder, CCheckIfIsLogged },
props: {},
setup() {
const userStore = useUserStore()

View File

@@ -1,5 +1,6 @@
<template>
<div class="q-my-sm">
<div v-if="tools.isLogged()">
<CNotifAtTop />
<!--<q-banner
rounded
@@ -14,11 +15,7 @@
</q-banner>-->
<CMyGroups
v-model="filter"
:finder="true"
>
<CMyGroups v-model="filter" :finder="true">
<CFinder
:ind="tools.getIndMainCardsByTable(toolsext.TABMYGROUPS)"
:table="toolsext.TABMYGROUPS"
@@ -54,8 +51,10 @@
-->
</CMyGroups>
<div v-if="filter === costanti.CREATE_GROUP">
Nuovo Gruppo:
<div v-if="filter === costanti.CREATE_GROUP">Nuovo Gruppo:</div>
</div>
<div v-else>
<CCheckIfIsLogged></CCheckIfIsLogged>
</div>
</div>
</template>
@@ -64,6 +63,6 @@
</script>
<style lang="scss" scoped>
@import './mygroups.scss';
@import "./mygroups.scss";
</style>