diff --git a/.env.development b/.env.development index aae86ce0..19c38895 100755 --- a/.env.development +++ b/.env.development @@ -1,6 +1,6 @@ APP_VERSION="1.0.33" SERVICE_WORKER_FILE="service-worker.js" -APP_ID="13" +APP_ID="17" 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='riso-logo-full.png' +LOGO_REG='piuchebuono-logo-full.png' TEST_NAME="Paolo" TEST_SURNAME="Arena" TEST_EMAIL="" diff --git a/public/images/comuni_italia.geojson b/_ALL_SITES/riso.app/images/comuni_italia.geojson similarity index 100% rename from public/images/comuni_italia.geojson rename to _ALL_SITES/riso.app/images/comuni_italia.geojson diff --git a/_ALL_SITES/riso.app/package.json b/_ALL_SITES/riso.app/package.json index 98e49747..bcb1a608 100755 --- a/_ALL_SITES/riso.app/package.json +++ b/_ALL_SITES/riso.app/package.json @@ -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", diff --git a/_ALL_SITES/riso.app/quasar.conf.js b/_ALL_SITES/riso.app/quasar.conf.js index 640a0360..239d042e 100755 --- a/_ALL_SITES/riso.app/quasar.conf.js +++ b/_ALL_SITES/riso.app/quasar.conf.js @@ -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'), @@ -107,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/*')) diff --git a/now.txt b/now.txt index 9bc58f3e..e5f5d4ff 100644 --- a/now.txt +++ b/now.txt @@ -1 +1 @@ -TERMINA DI LAVORARE SU piuchebuono.app: (Sovrascrivo !) +TERMINA DI LAVORARE SU riso.app: (Sovrascrivo !) diff --git a/package.json b/package.json index bcb1a608..0ac8aa25 100755 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "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", + "name": "piuchebuono", + "version": "2.0.1", + "description": "PiuCheBuono", + "productName": "PiuCheBuono", "author": "Paolo Arena", "private": true, "keywords": [], @@ -43,6 +43,7 @@ "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", diff --git a/public/images/ferrara.jpg b/public/images/ferrara.jpg deleted file mode 100644 index b4615a3a..00000000 Binary files a/public/images/ferrara.jpg and /dev/null differ diff --git a/public/images/foto1.jpg b/public/images/foto1.jpg old mode 100755 new mode 100644 index 6a0644be..195e9448 Binary files a/public/images/foto1.jpg and b/public/images/foto1.jpg differ diff --git a/public/images/foto2.jpg b/public/images/foto2.jpg old mode 100755 new mode 100644 index 6a0644be..940baa89 Binary files a/public/images/foto2.jpg and b/public/images/foto2.jpg differ diff --git a/public/images/foto3.jpg b/public/images/foto3.jpg old mode 100755 new mode 100644 index 6a0644be..effb7a77 Binary files a/public/images/foto3.jpg and b/public/images/foto3.jpg differ diff --git a/public/images/icon.png b/public/images/icon.png deleted file mode 100644 index ddf8a46c..00000000 Binary files a/public/images/icon.png and /dev/null differ diff --git a/public/images/kolibrilab-logo-full.png b/public/images/kolibrilab-logo-full.png new file mode 100755 index 00000000..6915ebba Binary files /dev/null and b/public/images/kolibrilab-logo-full.png differ diff --git a/public/images/marker-shadow.png b/public/images/marker-shadow.png deleted file mode 100644 index 9fd29795..00000000 Binary files a/public/images/marker-shadow.png and /dev/null differ diff --git a/public/images/marocco_foto1.png b/public/images/marocco_foto1.png new file mode 100644 index 00000000..7dceb8eb Binary files /dev/null and b/public/images/marocco_foto1.png differ diff --git a/public/images/noi4.jpg b/public/images/noi4.jpg new file mode 100644 index 00000000..850651ed Binary files /dev/null and b/public/images/noi4.jpg differ diff --git a/public/images/nuda_e_cruda.jpeg b/public/images/nuda_e_cruda.jpeg new file mode 100644 index 00000000..d7912a1e Binary files /dev/null and b/public/images/nuda_e_cruda.jpeg differ diff --git a/public/images/pcb-android-icon-144x144.png b/public/images/pcb-android-icon-144x144.png new file mode 100644 index 00000000..fdea5eb1 Binary files /dev/null and b/public/images/pcb-android-icon-144x144.png differ diff --git a/public/images/pcb-android-icon-192x192.png b/public/images/pcb-android-icon-192x192.png new file mode 100644 index 00000000..93bb5fb7 Binary files /dev/null and b/public/images/pcb-android-icon-192x192.png differ diff --git a/public/images/pcb-android-icon-36x36.png b/public/images/pcb-android-icon-36x36.png new file mode 100644 index 00000000..f700c0d2 Binary files /dev/null and b/public/images/pcb-android-icon-36x36.png differ diff --git a/public/images/pcb-android-icon-48x48.png b/public/images/pcb-android-icon-48x48.png new file mode 100644 index 00000000..4018b080 Binary files /dev/null and b/public/images/pcb-android-icon-48x48.png differ diff --git a/public/images/pcb-android-icon-72x72.png b/public/images/pcb-android-icon-72x72.png new file mode 100644 index 00000000..fdaff445 Binary files /dev/null and b/public/images/pcb-android-icon-72x72.png differ diff --git a/public/images/pcb-android-icon-96x96.png b/public/images/pcb-android-icon-96x96.png new file mode 100644 index 00000000..74ae0a32 Binary files /dev/null and b/public/images/pcb-android-icon-96x96.png differ diff --git a/public/images/pcb-apple-icon-114x114.png b/public/images/pcb-apple-icon-114x114.png new file mode 100644 index 00000000..de67dfff Binary files /dev/null and b/public/images/pcb-apple-icon-114x114.png differ diff --git a/public/images/pcb-apple-icon-120x120.png b/public/images/pcb-apple-icon-120x120.png new file mode 100644 index 00000000..5864c9c8 Binary files /dev/null and b/public/images/pcb-apple-icon-120x120.png differ diff --git a/public/images/pcb-apple-icon-144x144.png b/public/images/pcb-apple-icon-144x144.png new file mode 100644 index 00000000..fdea5eb1 Binary files /dev/null and b/public/images/pcb-apple-icon-144x144.png differ diff --git a/public/images/pcb-apple-icon-152x152.png b/public/images/pcb-apple-icon-152x152.png new file mode 100644 index 00000000..6e92509a Binary files /dev/null and b/public/images/pcb-apple-icon-152x152.png differ diff --git a/public/images/pcb-apple-icon-180x180.png b/public/images/pcb-apple-icon-180x180.png new file mode 100644 index 00000000..4d59cedc Binary files /dev/null and b/public/images/pcb-apple-icon-180x180.png differ diff --git a/public/images/pcb-apple-icon-57x57.png b/public/images/pcb-apple-icon-57x57.png new file mode 100644 index 00000000..fb201a9d Binary files /dev/null and b/public/images/pcb-apple-icon-57x57.png differ diff --git a/public/images/pcb-apple-icon-60x60.png b/public/images/pcb-apple-icon-60x60.png new file mode 100644 index 00000000..3b5f1c33 Binary files /dev/null and b/public/images/pcb-apple-icon-60x60.png differ diff --git a/public/images/pcb-apple-icon-72x72.png b/public/images/pcb-apple-icon-72x72.png new file mode 100644 index 00000000..fdaff445 Binary files /dev/null and b/public/images/pcb-apple-icon-72x72.png differ diff --git a/public/images/pcb-apple-icon-76x76.png b/public/images/pcb-apple-icon-76x76.png new file mode 100644 index 00000000..2882992b Binary files /dev/null and b/public/images/pcb-apple-icon-76x76.png differ diff --git a/public/images/pcb-apple-icon.png b/public/images/pcb-apple-icon.png new file mode 100644 index 00000000..422a8dca Binary files /dev/null and b/public/images/pcb-apple-icon.png differ diff --git a/public/images/piuchebuono-logo-full.png b/public/images/piuchebuono-logo-full.png new file mode 100644 index 00000000..5465d80c Binary files /dev/null and b/public/images/piuchebuono-logo-full.png differ diff --git a/public/images/piuchebuono.jpg b/public/images/piuchebuono.jpg new file mode 100644 index 00000000..88e9bab0 Binary files /dev/null and b/public/images/piuchebuono.jpg differ diff --git a/public/images/riso-android-icon-144x144.png b/public/images/riso-android-icon-144x144.png deleted file mode 100644 index 37dcd661..00000000 Binary files a/public/images/riso-android-icon-144x144.png and /dev/null differ diff --git a/public/images/riso-android-icon-192x192.png b/public/images/riso-android-icon-192x192.png deleted file mode 100644 index 95b960e9..00000000 Binary files a/public/images/riso-android-icon-192x192.png and /dev/null differ diff --git a/public/images/riso-android-icon-36x36.png b/public/images/riso-android-icon-36x36.png deleted file mode 100644 index c78a13a3..00000000 Binary files a/public/images/riso-android-icon-36x36.png and /dev/null differ diff --git a/public/images/riso-android-icon-384x384.png b/public/images/riso-android-icon-384x384.png deleted file mode 100644 index ce1ffc47..00000000 Binary files a/public/images/riso-android-icon-384x384.png and /dev/null differ diff --git a/public/images/riso-android-icon-48x48.png b/public/images/riso-android-icon-48x48.png deleted file mode 100644 index 499e8674..00000000 Binary files a/public/images/riso-android-icon-48x48.png and /dev/null differ diff --git a/public/images/riso-android-icon-512x512.png b/public/images/riso-android-icon-512x512.png deleted file mode 100644 index e1c31acd..00000000 Binary files a/public/images/riso-android-icon-512x512.png and /dev/null differ diff --git a/public/images/riso-android-icon-72x72.png b/public/images/riso-android-icon-72x72.png deleted file mode 100644 index f95f7320..00000000 Binary files a/public/images/riso-android-icon-72x72.png and /dev/null differ diff --git a/public/images/riso-android-icon-96x96.png b/public/images/riso-android-icon-96x96.png deleted file mode 100644 index 98dbf9d9..00000000 Binary files a/public/images/riso-android-icon-96x96.png and /dev/null differ diff --git a/public/images/riso-apple-icon-114x114.png b/public/images/riso-apple-icon-114x114.png deleted file mode 100644 index 882dd21c..00000000 Binary files a/public/images/riso-apple-icon-114x114.png and /dev/null differ diff --git a/public/images/riso-apple-icon-120x120.png b/public/images/riso-apple-icon-120x120.png deleted file mode 100644 index 734b0503..00000000 Binary files a/public/images/riso-apple-icon-120x120.png and /dev/null differ diff --git a/public/images/riso-apple-icon-144x144.png b/public/images/riso-apple-icon-144x144.png deleted file mode 100644 index 923da7be..00000000 Binary files a/public/images/riso-apple-icon-144x144.png and /dev/null differ diff --git a/public/images/riso-apple-icon-152x152.png b/public/images/riso-apple-icon-152x152.png deleted file mode 100644 index 84fd455d..00000000 Binary files a/public/images/riso-apple-icon-152x152.png and /dev/null differ diff --git a/public/images/riso-apple-icon-180x180.png b/public/images/riso-apple-icon-180x180.png deleted file mode 100644 index e457d906..00000000 Binary files a/public/images/riso-apple-icon-180x180.png and /dev/null differ diff --git a/public/images/riso-apple-icon-57x57.png b/public/images/riso-apple-icon-57x57.png deleted file mode 100644 index f5f538db..00000000 Binary files a/public/images/riso-apple-icon-57x57.png and /dev/null differ diff --git a/public/images/riso-apple-icon-60x60.png b/public/images/riso-apple-icon-60x60.png deleted file mode 100644 index 4121f834..00000000 Binary files a/public/images/riso-apple-icon-60x60.png and /dev/null differ diff --git a/public/images/riso-apple-icon-72x72.png b/public/images/riso-apple-icon-72x72.png deleted file mode 100644 index 5efd872d..00000000 Binary files a/public/images/riso-apple-icon-72x72.png and /dev/null differ diff --git a/public/images/riso-apple-icon-76x76.png b/public/images/riso-apple-icon-76x76.png deleted file mode 100644 index 6db4b76f..00000000 Binary files a/public/images/riso-apple-icon-76x76.png and /dev/null differ diff --git a/public/images/riso-apple-icon.png b/public/images/riso-apple-icon.png deleted file mode 100644 index cfaeb3c0..00000000 Binary files a/public/images/riso-apple-icon.png and /dev/null differ diff --git a/public/images/riso-logo-full.png b/public/images/riso-logo-full.png deleted file mode 100644 index 38a9695f..00000000 Binary files a/public/images/riso-logo-full.png and /dev/null differ diff --git a/public/images/riso_home.png b/public/images/riso_home.png deleted file mode 100644 index 3d065405..00000000 Binary files a/public/images/riso_home.png and /dev/null differ diff --git a/public/images/riso_home_dark.png b/public/images/riso_home_dark.png deleted file mode 100644 index fe6b8225..00000000 Binary files a/public/images/riso_home_dark.png and /dev/null differ diff --git a/public/images/riso_services.png b/public/images/riso_services.png deleted file mode 100644 index 85a940bc..00000000 Binary files a/public/images/riso_services.png and /dev/null differ diff --git a/quasar.conf.js b/quasar.conf.js index 239d042e..c306658e 100755 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -68,7 +68,6 @@ 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'), @@ -95,6 +94,7 @@ module.exports = configure((ctx) => ({ transpileDependencies: [ /quasar-ui-qcalendar[\\/]src/ ], + devtool: 'source-map', chainWebpack(chain, { isServer, isClient }) { chain.resolve.alias @@ -108,7 +108,6 @@ 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/*')) @@ -149,9 +148,8 @@ module.exports = configure((ctx) => ({ }, devServer: { https: false, - port: 8084, + port: 8088, open: false, // opens browser window automatically - hot: false, // Disable hot module replacement headers: { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': '*', @@ -297,8 +295,8 @@ module.exports = configure((ctx) => ({ workboxPluginMode: 'InjectManifest', // 'GenerateSW' or 'InjectManifest' workboxOptions: {}, // only for GenerateSW extendGenerateSWOptions(cfg) { - cfg.skipWaiting = false - cfg.clientsClaim = false + cfg.skipWaiting = true + cfg.clientsClaim = true }, // for the custom service worker ONLY (/src-pwa/custom-service-worker.[js|ts]) // if using workbox in InjectManifest mode @@ -308,9 +306,9 @@ module.exports = configure((ctx) => ({ }, manifest: { - 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.', + name: 'Più che Buono', + short_name: 'PiuCheBuono', + description: 'PiuCheBuono è un GAS e Bottega', display: 'standalone', orientation: 'portrait', background_color: '#fff', @@ -320,54 +318,54 @@ module.exports = configure((ctx) => ({ start_url: "/?homescreen=1", icons: [ { - src: 'images/riso-android-icon-512x512.png', + src: 'images/pcb-android-icon-512x512.png', sizes: '512x512', type: 'image/png', }, { - src: 'images/riso-android-icon-384x384.png', + src: 'images/pcb-android-icon-384x384.png', sizes: '384x384', type: 'image/png', }, { - src: 'images/riso-android-icon-192x192.png', + src: 'images/pcb-android-icon-192x192.png', sizes: '192x192', type: 'image/png', }, { - src: 'images/riso-android-icon-144x144.png', + src: 'images/pcb-android-icon-144x144.png', sizes: '144x144', type: 'image/png', }, { - src: 'images/riso-android-icon-96x96.png', + src: 'images/pcb-android-icon-96x96.png', sizes: '96x96', type: 'image/png', }, { - src: 'images/riso-apple-icon-120x120.png', + src: 'images/pcb-apple-icon-120x120.png', sizes: '120x120', type: 'image/png', }, { - src: 'images/riso-apple-icon-144x144.png', + src: 'images/pcb-apple-icon-144x144.png', sizes: '144x144', type: 'image/png', }, { - src: 'images/riso-apple-icon-152x152.png', + src: 'images/pcb-apple-icon-152x152.png', sizes: '152x152', type: 'image/png', }, { - src: 'images/riso-apple-icon-180x180.png', + src: 'images/pcb-apple-icon-180x180.png', sizes: '180x180', type: 'image/png', }, ], related_applications: [{ "platform": "webapp", - "url": "https://www.riso.app/manifest.json" + "url": "https://www.piuchebuono.app/manifest.json" }] }, }, @@ -402,7 +400,7 @@ module.exports = configure((ctx) => ({ builder: { // https://www.electron.build/configuration/configuration - appId: 'Riso', + appId: 'PiuCheBuono', }, // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain diff --git a/src-pwa/custom-service-worker.js b/src-pwa/custom-service-worker.js index a627473e..3b587c76 100755 --- a/src-pwa/custom-service-worker.js +++ b/src-pwa/custom-service-worker.js @@ -468,6 +468,7 @@ self.addEventListener('sync', function (event) { let table = multiparams[1] let method = multiparams[2] let token = multiparams[3] + let refreshToken = multiparams[4] // let lang = multiparams[3] if (cmd === 'sync-todos') { @@ -477,6 +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) // console.log('A1) INIZIO.............................................................'); diff --git a/src/common/axios.ts b/src/common/axios.ts index 77de501d..3cc4bf3f 100755 --- a/src/common/axios.ts +++ b/src/common/axios.ts @@ -19,6 +19,7 @@ function handle(status: number, exclude: number[]) { return exclude.find(o => o === status) === undefined } + export function UseAxios(router: any) { // VueRouter if (!initialized) { // @ts-ignore @@ -42,10 +43,10 @@ export function UseAxios(router: any) { // VueRouter return config }) - axios.interceptors.response.use(undefined, (config: AxiosError) => { + axios.interceptors.response.use(undefined, (error: AxiosError) => { // @ts-ignore - const { response } = config - const exclude = (config.config).ignore || [] + const { response } = error + const exclude = (error.config).ignore || [] if (response) { if (response.status === 401 && handle(response.status, exclude)) { @@ -59,10 +60,11 @@ export function UseAxios(router: any) { // VueRouter if (response.status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN && handle(response.status, exclude)) { window.setTimeout(() => router.replace('/forbidden'), 200) + // } else if (response.status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_TOKEN_EXPIRED) { } } - return config + return error }) initialized = true diff --git a/src/components/CMyCardGrpPopup/CMyCardGrpPopup.vue b/src/components/CMyCardGrpPopup/CMyCardGrpPopup.vue index a3d7a453..0206a699 100644 --- a/src/components/CMyCardGrpPopup/CMyCardGrpPopup.vue +++ b/src/components/CMyCardGrpPopup/CMyCardGrpPopup.vue @@ -4,47 +4,40 @@ - + - {{ myrec.title }} ({{ myrec.groupname }}) - +
- + alt="immagine del gruppo" + >
-
-
- -
+ v-if="(mycol.visible && (tools.checkIfShowField(mycol, tools.TIPOVIS_SHOW_RECORD, false, tools.getValue(myrec, mycol.field, mycol.subfield))))" + > +
+
-
- {{ tools.getValue(myrec, mycol.field, mycol.subfield) }} -
-
-
+
{{ tools.getValue(myrec, mycol.field, mycol.subfield) }}
+
- - + :canModify="false" + >
- + :canModify="false" + >
+ @click="condividipag" + >
-

+
+
- @@ -95,6 +92,6 @@ diff --git a/src/components/CMyCardService/CMyCardService.vue b/src/components/CMyCardService/CMyCardService.vue index 8436828f..fdde421a 100644 --- a/src/components/CMyCardService/CMyCardService.vue +++ b/src/components/CMyCardService/CMyCardService.vue @@ -29,7 +29,7 @@ @click.stop="tools.copyToClip($q, getlinkpage(), true)" > - + {{ $t('reaction.condividi') }} diff --git a/src/components/CMyElem/CMyElem.ts b/src/components/CMyElem/CMyElem.ts index f496c30a..7368e9d0 100755 --- a/src/components/CMyElem/CMyElem.ts +++ b/src/components/CMyElem/CMyElem.ts @@ -112,7 +112,8 @@ export default defineComponent({ const neworder = ref(0) - const myel = toRef(props, 'myelem') + const myel = ref({}) + const newtype = ref('') const isAppRunning = computed(() => globalStore.isAppRunning ) @@ -170,7 +171,7 @@ export default defineComponent({ const newrec = props.myelem newrec._id = undefined - newrec.order = order ? order : newrec.order! + 10 + newrec.order = order ? order : (newrec.order! + 10) globalStore.addNewElem($q, t, newrec) } @@ -204,6 +205,9 @@ export default defineComponent({ } function mounted() { + console.log('mounted elem ') + console.log(props.myelem.type) + myel.value = props.myelem neworder.value = props.myelem.order if (props.myelem) @@ -240,7 +244,7 @@ export default defineComponent({ } function showFit() { - if (props.myelem.type) + if (props.myelem && props.myelem.type) return [shared_consts.ELEMTYPE.TEXT].includes(props.myelem.type) else return false diff --git a/src/components/CMyElem/CMyElem.vue b/src/components/CMyElem/CMyElem.vue index dc3af7c8..d10b23f6 100755 --- a/src/components/CMyElem/CMyElem.vue +++ b/src/components/CMyElem/CMyElem.vue @@ -9,7 +9,7 @@ " @click="clickOnElem" > -
+
diff --git a/src/components/CMyPageElem/CMyPageElem.ts b/src/components/CMyPageElem/CMyPageElem.ts index 4be6c946..0b955cd8 100755 --- a/src/components/CMyPageElem/CMyPageElem.ts +++ b/src/components/CMyPageElem/CMyPageElem.ts @@ -90,11 +90,12 @@ export default defineComponent({ }) function load() { - // console.log('load', mypathin.value) + console.log('load', mypathin.value) if (mypathin.value !== '') { globalStore.loadPage('/' + mypathin.value, 'cmypageelem').then(ris => { rec.value = ris + console.log('LoadPage', ris) }) } diff --git a/src/components/CMyPageElem/CMyPageElem.vue b/src/components/CMyPageElem/CMyPageElem.vue index 0bb9711d..46fedc81 100755 --- a/src/components/CMyPageElem/CMyPageElem.vue +++ b/src/components/CMyPageElem/CMyPageElem.vue @@ -32,6 +32,7 @@ @click="visuEditor = false; selElem = {};" > +
+ 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, @@ -57,72 +33,7 @@ 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', @@ -132,6 +43,17 @@ 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, @@ -145,18 +67,7 @@ function getDynamicPages(site: ISites): IListRoutes[] { infooter: false, }, { - 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, + active: site.confpages && site.confpages.showProfile, order: 120, path: '/editprofile', materialIcon: 'fas fa-user', @@ -167,7 +78,7 @@ function getDynamicPages(site: ISites): IListRoutes[] { infooter: false, }, { - active: true, + active: site.confpages && site.confpages.showiscrittiMenu, order: 130, path: '/friends', materialIcon: 'fas fa-user-friends', @@ -177,6 +88,19 @@ 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, @@ -187,6 +111,8 @@ function getDynamicPages(site: ISites): IListRoutes[] { meta: { requiresAuth: true }, inmenu: true, infooter: false, + onlyAdmin: true, + onlyManager: true, }, { active: true, diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts index 26903a81..66f39bb7 100755 --- a/src/model/GlobalStore.ts +++ b/src/model/GlobalStore.ts @@ -247,6 +247,7 @@ export interface IConfPages { enableTodos: boolean enableRegByBot: boolean enableRegMultiChoice: boolean + enableTokenExpired: boolean enableDebugOn: boolean enabledRegNeedTelegram: boolean showViewGroups: boolean diff --git a/src/model/other.ts b/src/model/other.ts index c9d0d2ef..63eebf08 100755 --- a/src/model/other.ts +++ b/src/model/other.ts @@ -2,6 +2,7 @@ export interface IToken { access: string // browser: string token: string + refreshToken: string data_login: Date } diff --git a/src/rootgen/admin/confsite/confsite.vue b/src/rootgen/admin/confsite/confsite.vue index 0662be97..8340f5ae 100755 --- a/src/rootgen/admin/confsite/confsite.vue +++ b/src/rootgen/admin/confsite/confsite.vue @@ -633,6 +633,16 @@ :type="costanti.FieldType.boolean" > + + { const mydataout = { ...mydata, @@ -103,7 +135,7 @@ export const Api = { userStore.setResStatus(0) // eslint-disable-next-line @typescript-eslint/no-misused-promises return new Promise((resolve, reject) => sendRequest(url, method, mydataout) - .then((res) => { + .then(async (res) => { // console.log('status:', res.status) setTimeout(() => { @@ -121,9 +153,24 @@ export const Api = { // Forbidden // You probably is connectiong with other page... userStore.setServerCode(toolsext.ERR_AUTHENTICATION) - userStore.setAuth('') + 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()) @@ -162,7 +209,7 @@ export const Api = { let lettoqualcosa = false // console.log('A1) INIZIO.............................................................') - return globalroutines( 'readall', tablesync, null) + return globalroutines('readall', tablesync, null) .then((alldata) => { if (alldata === undefined) { console.log('alldata NON DEFINITA') @@ -184,10 +231,10 @@ export const Api = { .then((ris) => { ReceiveResponsefromServer(tablesync, nametab, method, ris.data) lettoqualcosa = true - return globalroutines( 'delete', tablesync, null, rec._id) + return globalroutines('delete', tablesync, null, rec._id) }) .then(() => { - return globalroutines( 'delete', 'swmsg', null, mystrparam) + return globalroutines('delete', 'swmsg', null, mystrparam) }).catch((err) => { if (err.msgerr) { if (err.msgerr.message.includes('Failed to fetch') || err.msgerr.message.includes('Network Error')) { @@ -196,7 +243,7 @@ export const Api = { } console.log(' [Alternative] !!!!!!!!!!!!!!! Error while sending data', err, errorfromserver, 'lettoqualcosa', lettoqualcosa) if (!errorfromserver) { - return globalroutines( 'delete', 'swmsg', null, mystrparam) + return globalroutines('delete', 'swmsg', null, mystrparam) } }) }) diff --git a/src/store/Modules/serv_constants.ts b/src/store/Modules/serv_constants.ts index eb78ddf0..f75e56b2 100755 --- a/src/store/Modules/serv_constants.ts +++ b/src/store/Modules/serv_constants.ts @@ -28,6 +28,7 @@ export const serv_constants = { RIS_CODE_LOGIN_OK: 1, RIS_ISCRIZIONE_OK: 5, RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN: 403, + RIS_CODE__HTTP_FORBIDDEN_TOKEN_EXPIRED: 408, RIS_CODE_TOKEN_RESETPASSWORD_NOT_FOUND: -23, diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index 0b8ca9ed..37766576 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -4396,7 +4396,7 @@ export const tools = { }, getheaders() { const userStore = useUserStore() - return [{ name: 'x-auth', value: userStore.x_auth_token }] + return [{ name: 'x-auth', value: userStore.x_auth_token }, { name: 'x-refrTok', value: userStore.refreshToken }] }, getextfile(filename: string) { @@ -8510,8 +8510,12 @@ export const tools = { }, getInvitante() { - const invitante = tools.getCookie(tools.APORTADOR_SOLIDARIO) - return invitante ? invitante : '' + try { + const invitante = tools.getCookie(tools.APORTADOR_SOLIDARIO, '') + return invitante ? invitante : '' + } catch (e) { + return '' + } }, contieneSlash(str: string) { diff --git a/src/store/Modules/toolsext.ts b/src/store/Modules/toolsext.ts index 91b955cf..b682d1b5 100755 --- a/src/store/Modules/toolsext.ts +++ b/src/store/Modules/toolsext.ts @@ -117,6 +117,7 @@ export const toolsext = { leftDrawerOpen: 'ldo', userId: 'uid', token: 'tk', + refreshToken: 'rt', username: 'uname', name: 'nm', surname: 'sn', diff --git a/src/store/UserStore.ts b/src/store/UserStore.ts index 3002cefc..76db614f 100755 --- a/src/store/UserStore.ts +++ b/src/store/UserStore.ts @@ -196,6 +196,7 @@ export const useUserStore = defineStore('UserStore', { servercode: 0, resStatus: 0, x_auth_token: '', + refreshToken: '', isLogged: false, isAdmin: false, isManager: false, @@ -803,6 +804,7 @@ export const useUserStore = defineStore('UserStore', { this.resStatus = 0 this.isLogged = false this.x_auth_token = '' + this.refreshToken = '' return true }, @@ -1115,7 +1117,7 @@ export const useUserStore = defineStore('UserStore', { this.my.tokens = [] this.resetArrToken(this.my.tokens) - this.my.tokens.push({ access: 'auth', token: this.x_auth_token, data_login: tools.getDateNow() }) + this.my.tokens.push({ access: 'auth', token: this.x_auth_token, refreshToken: this.refreshToken, data_login: tools.getDateNow() }) } catch (e) { console.log('Error authUser: ' + e) @@ -1139,6 +1141,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) + localStorage.setItem(toolsext.localStorage.refreshToken, this.refreshToken) localStorage.setItem(toolsext.localStorage.expirationDate, expirationDate.toString()) tools.localStSetItem(toolsext.localStorage.isLogged, String(true)) tools.localStSetItem(toolsext.localStorage.verified_email, String(myuser.verified_email)) @@ -1200,6 +1203,7 @@ export const useUserStore = defineStore('UserStore', { tools.localStSetItem(toolsext.localStorage.name, newuser.name) tools.localStSetItem(toolsext.localStorage.surname, newuser.surname) localStorage.setItem(toolsext.localStorage.token, this.x_auth_token) + localStorage.setItem(toolsext.localStorage.refreshToken, this.refreshToken) localStorage.setItem(toolsext.localStorage.expirationDate, expirationDate.toString()) tools.localStSetItem(toolsext.localStorage.verified_email, String(false)) tools.localStSetItem(toolsext.localStorage.verified_by_aportador, String(false)) @@ -1223,12 +1227,13 @@ export const useUserStore = defineStore('UserStore', { }) }, - UpdatePwd(x_auth_token: string) { + UpdatePwd(x_auth_token: string, refreshToken: string) { this.x_auth_token = x_auth_token + this.refreshToken = refreshToken if (!this.my.tokens) { this.my.tokens = [] } - this.my.tokens.push({ access: 'auth', token: x_auth_token, data_login: tools.getDateNow() }) + this.my.tokens.push({ access: 'auth', token: x_auth_token, refreshToken, data_login: tools.getDateNow() }) }, setServerCode(num: number) { @@ -1239,8 +1244,9 @@ export const useUserStore = defineStore('UserStore', { this.resStatus = status }, - setAuth(x_auth_token: string) { + setAuth(x_auth_token: string, refreshToken: string) { this.x_auth_token = x_auth_token + this.refreshToken = refreshToken }, resetArrToken(arrtokens: IToken[]) { @@ -1297,7 +1303,7 @@ export const useUserStore = defineStore('UserStore', { }, async signin(router: Router, authData: ISigninOptions) { - console.log('LOGIN signin') + // console.log('LOGIN signin') const globalStore = useGlobalStore() const options = { @@ -1324,7 +1330,7 @@ export const useUserStore = defineStore('UserStore', { let myres: any - console.log('executing login...') + // console.log('executing login...') return await Api.SendReq('/users/login', 'POST', usertosend, true) .then((res) => { @@ -1435,7 +1441,7 @@ export const useUserStore = defineStore('UserStore', { this.isLogged = isok && isLogged - // console.log('this.isLogged', this.isLogged, 'isok', isok, 'isLogged', isLogged) + console.log('this.isLogged', this.isLogged, 'isok', isok, 'isLogged', isLogged) if (globalStore.site.confpages && globalStore.site.confpages.enableTodos) await todos.dbLoad({ checkPending: true }) @@ -1476,17 +1482,20 @@ export const useUserStore = defineStore('UserStore', { this.lang = tools.getItemLS(toolsext.localStorage.lang) const token = localStorage.getItem(toolsext.localStorage.token) + let refreshToken = localStorage.getItem(toolsext.localStorage.refreshToken) + if (!refreshToken) + refreshToken = '' if (token) { - const expirationDateStr = localStorage.getItem(toolsext.localStorage.expirationDate) - const expirationDate = new Date(String(expirationDateStr)) - const now = tools.getDateNow() - if (now < expirationDate) { - this.setAuth(token) - isLogged = true - - } else { - // ++ ?? che fare qui + this.setAuth(token, refreshToken) + if (globalStore.site.confpages.enableTokenExpired) { + if (token && refreshToken) { + isLogged = true + } else { + if (token) { + isLogged = true + } + } } } else { isLogged = tools.isLogged() diff --git a/src/store/globalStore.ts b/src/store/globalStore.ts index 1a03c937..b27cd26a 100644 --- a/src/store/globalStore.ts +++ b/src/store/globalStore.ts @@ -180,6 +180,7 @@ export const useGlobalStore = defineStore('GlobalStore', { enableTodos: false, enableRegByBot: false, enableRegMultiChoice: false, + enableTokenExpired: false, enabledRegNeedTelegram: false, enableDebugOn: false, showButtHome: false, @@ -874,7 +875,11 @@ export const useGlobalStore = defineStore('GlobalStore', { async deleteSubscriptionToServer() { console.log('DeleteSubscriptionToServer: ') + try { return Api.SendReq('/subscribe/del', 'DELETE', null) + }catch (e) { + console.error('deleteSubscriptionToServer') + } }, async clearDataAfterLogout() { @@ -946,7 +951,7 @@ export const useGlobalStore = defineStore('GlobalStore', { }, async checkUpdates() { - // console.log('checkUpdates') + console.log('checkUpdates') const userStore = useUserStore() diff --git a/src/views/user/mygroup/mygroup.ts b/src/views/user/mygroup/mygroup.ts index ddf2ec4e..a33f9bf8 100755 --- a/src/views/user/mygroup/mygroup.ts +++ b/src/views/user/mygroup/mygroup.ts @@ -216,6 +216,10 @@ export default defineComponent({ return null } + function getlinkpage() { + return tools.getFullCurrentUrl() + } + onMounted(mounted) return { @@ -263,6 +267,7 @@ export default defineComponent({ circuitIndex, circuitslistOpt, filtroeventsgroup, + getlinkpage, } } }) diff --git a/src/views/user/mygroup/mygroup.vue b/src/views/user/mygroup/mygroup.vue index fcb97cfc..7d971c48 100755 --- a/src/views/user/mygroup/mygroup.vue +++ b/src/views/user/mygroup/mygroup.vue @@ -4,9 +4,8 @@

- Non hai i permessi per accedere al Gruppo.
- - Occorre prima registrarsi alla App + Non hai i permessi per accedere al Gruppo. +
Occorre prima registrarsi alla App

@@ -19,7 +18,7 @@ v-if="mygrp.descr" class="fit column no-wrap justify-evenly items-center content-start" > -
+
- {{ mygrp.title }} + {{ mygrp.title }}
- {{ mygrp.groupname }} -
+ >{{ mygrp.groupname }}
- {{ $t('db.youarerefusedgroup') }}
+ {{ $t('db.youarerefusedgroup') }} +
@@ -95,9 +92,11 @@ - {{ - $t('groups.exit_group') - }} + + {{ + $t('groups.exit_group') + }} + - {{ - $t('groups.delete_group') - }} + + {{ + $t('groups.delete_group') + }} + @@ -151,10 +152,20 @@ />
-
+
+
+ +
+
+ +
- + - + @@ -220,7 +223,7 @@ v-if=" !!mygrp.date_updated && tools.getstrshortDate(mygrp.date_updated) !== - tools.getstrshortDate(mygrp.createdBy) + tools.getstrshortDate(mygrp.createdBy) " class="element" > @@ -244,9 +247,7 @@
-
- {{ $t('groups.private') }} -
+
{{ $t('groups.private') }}
{{ $t('groups.private_descr') }}
@@ -274,9 +275,10 @@
-
- {{ city.comune }} ({{ city.prov }}) -
+
{{ city.comune }} ({{ city.prov }})
@@ -304,8 +306,7 @@ :mycontact="user" :visu="costanti.FIND_PEOPLE" @setCmd="tools.setCmd" - > - + >
@@ -334,8 +335,7 @@ :label="$t('msgs.telegrammsg')" :href="getLinkGrpTelegram()" target="__blank" - > - + >
- + >
@@ -400,10 +399,10 @@ - + > - + > @@ -464,7 +461,7 @@ map-options :behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'" > - +