Merge branch 'develop' of https://github.com/paoloar77/newfreeplanet into develop
Conflicts: .env.development
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
APP_VERSION="0.3.13"
|
APP_VERSION="0.3.14"
|
||||||
SERVICE_WORKER_FILE="service-worker.js"
|
SERVICE_WORKER_FILE="service-worker.js"
|
||||||
APP_ID="13"
|
APP_ID="13"
|
||||||
DIRECTORY_LOCAL="newfreeplanet"
|
DIRECTORY_LOCAL="newfreeplanet"
|
||||||
|
|||||||
27
.env.example.production
Executable file
27
.env.example.production
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
APP_VERSION="0.3.14"
|
||||||
|
SERVICE_WORKER_FILE="service-worker.js"
|
||||||
|
APP_ID="13"
|
||||||
|
DIRECTORY_LOCAL=newfreeplanet
|
||||||
|
DIRECTORY_SERVER=freeplanet_serverside
|
||||||
|
SERVERDIR_WEBSITE=riso.app
|
||||||
|
SERVERPW_WEBSITE=<password-website-here>
|
||||||
|
APP_URL="https://riso.app"
|
||||||
|
URL_FACEBOOK=""
|
||||||
|
PROVA_PAOLO=""
|
||||||
|
LANG_DEFAULT="it"
|
||||||
|
PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF"
|
||||||
|
MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T"
|
||||||
|
MONGODB_HOST="https://www.freeplanet.app:3000"
|
||||||
|
LOGO_REG='riso-logo-full.png'
|
||||||
|
TEST_NAME=""
|
||||||
|
TEST_SURNAME=""
|
||||||
|
TEST_EMAIL=""
|
||||||
|
TEST_USERNAME=""
|
||||||
|
TEST_PASSWORD=""
|
||||||
|
TEST_APORTADOR="------"
|
||||||
|
PUBLICKEY_PUSH="<publickey-push-here>"
|
||||||
|
DEBUG="1"
|
||||||
|
TELEGRAM_SUPPORT=""
|
||||||
|
PROJECT_ID_MAIN="5cc0a13fe5c9d156728f400a"
|
||||||
|
TEST_CELL=""
|
||||||
|
ISTEST=0
|
||||||
74
README.md
74
README.md
@@ -1,6 +1,69 @@
|
|||||||
# NewFreePlanet
|
<div>
|
||||||
|
|
||||||
|
# NewFreePlanet
|
||||||
|
#### (FrontEnd)
|
||||||
|
|
||||||
|
## Riso.app
|
||||||
|
**Il primo Vero Social**<br>
|
||||||
|
**Libero, Equo e Solidale**<br>
|
||||||
|
**dove Vive Consapevolezza e Aiuto Comunitario**<br>
|
||||||
|
|
||||||
|
## Uniti per Evolvere e Sperimentare
|
||||||
|
- 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.<br>
|
||||||
|
- E' giunta l'ora di utilizzare i nuovi strumenti Tecnologici a nostro favore, per Liberarci così piano piano dalla schiavitù del "Lavoro per generare Denaro" e trasformando le nostre Capacitá in Risorse Umane per poterci sostenere e vivere in Armonia con gli altri.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
This app was made mixing all this languages and tools:<br>
|
||||||
|
<ul>
|
||||||
|
<li>Quasar Framework v2.0</li>
|
||||||
|
<li>Vue.js 3 with Typescript and Composition API</li>
|
||||||
|
<li>Progressive Web App (PWA) amazing native-looking apps</li>
|
||||||
|
<li>Node.js (backend source)</li>
|
||||||
|
</ul>
|
||||||
|
Thanks to the Quasar Framework and TypeScript !
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
[](https://github.com/quasarframework/quasar)
|
||||||
|
[](https://github.com/Microsoft/TypeScript)
|
||||||
|
|
||||||
|
<!--[](https://opensource.org/licenses/MIT) -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
[](https://github.com/standard/standard)
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
## Installation 🔧
|
||||||
|
|
||||||
|
**System prerequisites :**
|
||||||
|
- Node.js 16.14.0 or latest
|
||||||
|
- yarn > 1.21.1 or latest
|
||||||
|
|
||||||
|
|
||||||
|
Clone this repository :
|
||||||
|
```bash
|
||||||
|
$ git clone git@github.com:paoloar77/newfreeplanet example
|
||||||
|
$ cd example
|
||||||
|
$ yarn
|
||||||
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
[MIT](https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2018-present, Paolo Arena
|
||||||
|
|
||||||
A Quasar Framework app
|
|
||||||
|
|
||||||
## Install the dependencies
|
## Install the dependencies
|
||||||
```bash
|
```bash
|
||||||
@@ -14,12 +77,19 @@ npm run pwa
|
|||||||
|
|
||||||
### Build the app for test Server
|
### Build the app for test Server
|
||||||
```bash
|
```bash
|
||||||
|
cp .env.example.production .env.test
|
||||||
|
nano .env.test
|
||||||
|
# and change SERVERPW_WEBSITE and PUBLICKEY_PUSH keys in this file
|
||||||
|
|
||||||
./deploy_on_test_server.sh
|
./deploy_on_test_server.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Build the app for production
|
### Build the app for production
|
||||||
```bash
|
```bash
|
||||||
|
cp .env.example.production .env.production
|
||||||
|
nano .env.production
|
||||||
|
# and change SERVERPW_WEBSITE and PUBLICKEY_PUSH keys in this file
|
||||||
./deploy_on_production.sh
|
./deploy_on_production.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
APP_VERSION="0.3.12"
|
APP_VERSION="0.3.14"
|
||||||
SERVICE_WORKER_FILE="service-worker.js"
|
SERVICE_WORKER_FILE="service-worker.js"
|
||||||
APP_ID="13"
|
APP_ID="13"
|
||||||
DIRECTORY_LOCAL="newfreeplanet"
|
DIRECTORY_LOCAL="newfreeplanet"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
APP_VERSION="0.3.12"
|
APP_VERSION="0.3.14"
|
||||||
SERVICE_WORKER_FILE="service-worker.js"
|
SERVICE_WORKER_FILE="service-worker.js"
|
||||||
APP_ID="12"
|
APP_ID="12"
|
||||||
DIRECTORY_LOCAL="newfreeplanet"
|
DIRECTORY_LOCAL="newfreeplanet"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
APP_VERSION="0.3.12"
|
APP_VERSION="0.3.14"
|
||||||
SERVICE_WORKER_FILE="service-worker.js"
|
SERVICE_WORKER_FILE="service-worker.js"
|
||||||
APP_ID="13"
|
APP_ID="13"
|
||||||
DIRECTORY_LOCAL="newfreeplanet"
|
DIRECTORY_LOCAL="newfreeplanet"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
APP_VERSION="0.3.12"
|
APP_VERSION="0.3.14"
|
||||||
SERVICE_WORKER_FILE="service-worker.js"
|
SERVICE_WORKER_FILE="service-worker.js"
|
||||||
APP_ID="13"
|
APP_ID="13"
|
||||||
DIRECTORY_LOCAL=newfreeplanet
|
DIRECTORY_LOCAL=newfreeplanet
|
||||||
|
|||||||
14
package.json
14
package.json
@@ -119,15 +119,15 @@
|
|||||||
"crypto": false
|
"crypto": false
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"last 13 Chrome versions",
|
"last 16 Chrome versions",
|
||||||
"last 13 Firefox versions",
|
"last 16 Firefox versions",
|
||||||
"last 4 Edge versions",
|
"last 4 Edge versions",
|
||||||
"last 13 Safari versions",
|
"last 13 Safari versions",
|
||||||
"last 14 Android versions",
|
"last 16 Android versions",
|
||||||
"last 14 ChromeAndroid versions",
|
"last 16 ChromeAndroid versions",
|
||||||
"last 14 FirefoxAndroid versions",
|
"last 16 FirefoxAndroid versions",
|
||||||
"last 10 iOS versions",
|
"last 12 iOS versions",
|
||||||
"last 5 Opera versions"
|
"last 7 Opera versions"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 16.14.0",
|
"node": ">= 16.14.0",
|
||||||
|
|||||||
@@ -796,7 +796,13 @@ export default defineComponent({
|
|||||||
recCatGrp: 1,
|
recCatGrp: 1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
lookup5: {
|
||||||
|
lk_tab: 'cities',
|
||||||
|
lk_LF: 'idCity',
|
||||||
|
lk_FF: '_id',
|
||||||
|
lk_as: 'mycities',
|
||||||
|
af_objId_tab: '',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (props.table === toolsext.TABMYGOODS) {
|
} else if (props.table === toolsext.TABMYGOODS) {
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function condividipag() {
|
function condividipag() {
|
||||||
return tools.copyStringToClipboard($q, self.location.host + tools.getPathByGroup(myrec.value, props.table), true)
|
const msg = self.location.host + tools.getPathByGroup(myrec.value, props.table)
|
||||||
|
return tools.copyStringToClipboard($q, msg, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(mounted)
|
onMounted(mounted)
|
||||||
|
|||||||
@@ -312,6 +312,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
// Check if exist other array:
|
// Check if exist other array:
|
||||||
if (props.col) {
|
if (props.col) {
|
||||||
|
|
||||||
if (props.col.remote_table && props.col.remote_key && props.col.remote_field) {
|
if (props.col.remote_table && props.col.remote_key && props.col.remote_field) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -118,13 +118,14 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
.then((riscode: number) => {
|
.then((riscode: number) => {
|
||||||
if (riscode === tools.OK) {
|
if (riscode === tools.OK) {
|
||||||
// console.log(' -> eseguo emit(loginOk)')
|
console.log(' -> eseguo emit(loginOk)')
|
||||||
|
|
||||||
emit('loginOk')
|
emit('loginOk')
|
||||||
|
|
||||||
globalStore.createPushSubscription()
|
globalStore.createPushSubscription()
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
console.log(' -> eseguo emit(checkErrors)')
|
||||||
emit('checkErrors', riscode)
|
emit('checkErrors', riscode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,11 @@ export default defineComponent({
|
|||||||
setup(props) {
|
setup(props) {
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
const globalStore = useGlobalStore()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
userStore,
|
userStore,
|
||||||
|
globalStore,
|
||||||
tools,
|
tools,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="q-ma-md">
|
<div v-if="!globalStore.serverError" class="q-ma-md">
|
||||||
<CVerifyTelegram v-if="!tools.TelegVerificato() || !tools.isUsernameTelegOk()">
|
<CVerifyTelegram v-if="!tools.TelegVerificato() || !tools.isUsernameTelegOk()">
|
||||||
|
|
||||||
</CVerifyTelegram>
|
</CVerifyTelegram>
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ const msg_website_it = {
|
|||||||
},
|
},
|
||||||
homepage: {
|
homepage: {
|
||||||
descrapp_title1: 'Uniti per Evolvere e Sperimentare',
|
descrapp_title1: 'Uniti per Evolvere e Sperimentare',
|
||||||
descrapp_pag1: 'Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della <strong>condivisione</strong> e della <strong>cooperazione</strong>. ' +
|
descrapp_pag1: 'Siamo la <strong>Rete Italiana di Scambio Orizzontale</strong>, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della <strong>condivisione</strong> e della <strong>cooperazione</strong>. ' +
|
||||||
'Valori semplici e profondi che ci aiutano a ritrovare il <strong>Senso della Vita</strong>, perduto in questa società consumista, e riporti quei <strong>Sani Pricìpi Naturali</strong> ed Umani di <strong>Fratellanza</strong>'
|
'Valori semplici e profondi che ci aiutano a ritrovare il <strong>Senso della Vita</strong>, perduto in questa società consumista, e riporti quei <strong>Sani Pricìpi Naturali</strong> ed Umani di <strong>Fratellanza</strong>'
|
||||||
+ ' che intere popolazioni antiche conoscevano bene.',
|
+ ' che intere popolazioni antiche conoscevano bene.',
|
||||||
descrapp_pag2: 'E\' giunta l\'ora di utilizzare i nuovi strumenti <strong>Tecnologici</strong> a nostro <strong>favore</strong>, per <strong>Liberarci</strong> '
|
descrapp_pag2: 'E\' giunta l\'ora di utilizzare i nuovi strumenti <strong>Tecnologici</strong> a nostro <strong>favore</strong>, per <strong>Liberarci</strong> '
|
||||||
|
|||||||
@@ -84,11 +84,11 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
|
|||||||
}
|
}
|
||||||
if (setAuthToken) {
|
if (setAuthToken) {
|
||||||
userStore.UpdatePwd(x_auth_token)
|
userStore.UpdatePwd(x_auth_token)
|
||||||
tools.localStSetItem(toolsext.localStorage.token, x_auth_token)
|
localStorage.setItem(toolsext.localStorage.token, x_auth_token)
|
||||||
}
|
}
|
||||||
|
|
||||||
userStore.setAuth(x_auth_token)
|
userStore.setAuth(x_auth_token)
|
||||||
tools.localStSetItem(toolsext.localStorage.token, x_auth_token)
|
localStorage.setItem(toolsext.localStorage.token, x_auth_token)
|
||||||
}
|
}
|
||||||
|
|
||||||
globalStore.setStateConnection(ricevuto ? 'online' : 'offline')
|
globalStore.setStateConnection(ricevuto ? 'online' : 'offline')
|
||||||
|
|||||||
@@ -670,7 +670,7 @@ export const colmyGoods = [
|
|||||||
fieldtype: costanti.FieldType.string,
|
fieldtype: costanti.FieldType.string,
|
||||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
||||||
noshowlabel: true,
|
noshowlabel: true,
|
||||||
maxlength: 90,
|
maxlength: 120,
|
||||||
required: true,
|
required: true,
|
||||||
sortable: false,
|
sortable: false,
|
||||||
}),
|
}),
|
||||||
@@ -837,7 +837,7 @@ export const colmySkills = [
|
|||||||
fieldtype: costanti.FieldType.string,
|
fieldtype: costanti.FieldType.string,
|
||||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
||||||
noshowlabel: true,
|
noshowlabel: true,
|
||||||
maxlength: 90,
|
maxlength: 120,
|
||||||
required: true,
|
required: true,
|
||||||
sortable: false,
|
sortable: false,
|
||||||
}),
|
}),
|
||||||
@@ -1010,7 +1010,7 @@ export const colmyBachecas = [
|
|||||||
fieldtype: costanti.FieldType.string,
|
fieldtype: costanti.FieldType.string,
|
||||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
||||||
noshowlabel: true,
|
noshowlabel: true,
|
||||||
maxlength: 90,
|
maxlength: 120,
|
||||||
required: true,
|
required: true,
|
||||||
sortable: false,
|
sortable: false,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -3364,6 +3364,10 @@ export const tools = {
|
|||||||
localStorage.setItem(item, value)
|
localStorage.setItem(item, value)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
localStReal(item: string, value : string) {
|
||||||
|
localStorage.setItem(item, value)
|
||||||
|
},
|
||||||
|
|
||||||
setCookie(mytok: any, value: string) {
|
setCookie(mytok: any, value: string) {
|
||||||
// console.log('setCookie', mytok, value)
|
// console.log('setCookie', mytok, value)
|
||||||
if (localStorage.getItem('cookie-id') === 'decline')
|
if (localStorage.getItem('cookie-id') === 'decline')
|
||||||
@@ -4138,8 +4142,9 @@ export const tools = {
|
|||||||
|
|
||||||
isLogged() {
|
isLogged() {
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
const globalStore = useGlobalStore()
|
||||||
if (!!userStore)
|
if (!!userStore)
|
||||||
return userStore.isLogged
|
return userStore.isLogged && !globalStore.serverError
|
||||||
else
|
else
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -540,8 +540,8 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
tools.localStSetItem(toolsext.localStorage.perm, String(myuser.perm) || '')
|
tools.localStSetItem(toolsext.localStorage.perm, String(myuser.perm) || '')
|
||||||
if (myuser.profile !== undefined) tools.localStSetItem(toolsext.localStorage.img, (myuser.profile.img) ? String(myuser.profile.img) || '' : '')
|
if (myuser.profile !== undefined) tools.localStSetItem(toolsext.localStorage.img, (myuser.profile.img) ? String(myuser.profile.img) || '' : '')
|
||||||
else tools.localStSetItem(toolsext.localStorage.img, '')
|
else tools.localStSetItem(toolsext.localStorage.img, '')
|
||||||
tools.localStSetItem(toolsext.localStorage.token, this.x_auth_token)
|
localStorage.setItem(toolsext.localStorage.token, this.x_auth_token)
|
||||||
tools.localStSetItem(toolsext.localStorage.expirationDate, expirationDate.toString())
|
localStorage.setItem(toolsext.localStorage.expirationDate, expirationDate.toString())
|
||||||
tools.localStSetItem(toolsext.localStorage.isLogged, String(true))
|
tools.localStSetItem(toolsext.localStorage.isLogged, String(true))
|
||||||
tools.localStSetItem(toolsext.localStorage.verified_email, String(myuser.verified_email))
|
tools.localStSetItem(toolsext.localStorage.verified_email, String(myuser.verified_email))
|
||||||
tools.localStSetItem(toolsext.localStorage.verified_by_aportador, String(myuser.verified_by_aportador))
|
tools.localStSetItem(toolsext.localStorage.verified_by_aportador, String(myuser.verified_by_aportador))
|
||||||
@@ -600,8 +600,8 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
tools.localStSetItem(toolsext.localStorage.username, newuser.username)
|
tools.localStSetItem(toolsext.localStorage.username, newuser.username)
|
||||||
tools.localStSetItem(toolsext.localStorage.name, newuser.name)
|
tools.localStSetItem(toolsext.localStorage.name, newuser.name)
|
||||||
tools.localStSetItem(toolsext.localStorage.surname, newuser.surname)
|
tools.localStSetItem(toolsext.localStorage.surname, newuser.surname)
|
||||||
tools.localStSetItem(toolsext.localStorage.token, this.x_auth_token)
|
localStorage.setItem(toolsext.localStorage.token, this.x_auth_token)
|
||||||
tools.localStSetItem(toolsext.localStorage.expirationDate, expirationDate.toString())
|
localStorage.setItem(toolsext.localStorage.expirationDate, expirationDate.toString())
|
||||||
tools.localStSetItem(toolsext.localStorage.verified_email, String(false))
|
tools.localStSetItem(toolsext.localStorage.verified_email, String(false))
|
||||||
tools.localStSetItem(toolsext.localStorage.verified_by_aportador, String(false))
|
tools.localStSetItem(toolsext.localStorage.verified_by_aportador, String(false))
|
||||||
|
|
||||||
@@ -815,6 +815,8 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
|
|
||||||
this.isLogged = isok && isLogged
|
this.isLogged = isok && isLogged
|
||||||
|
|
||||||
|
console.log('this.isLogged', this.isLogged, 'isok', isok, 'isLogged', isLogged)
|
||||||
|
|
||||||
if (static_data.functionality.ENABLE_TODOS_LOADING)
|
if (static_data.functionality.ENABLE_TODOS_LOADING)
|
||||||
await todos.dbLoad({ checkPending: true })
|
await todos.dbLoad({ checkPending: true })
|
||||||
|
|
||||||
@@ -842,7 +844,7 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
try {
|
try {
|
||||||
const globalStore = useGlobalStore()
|
const globalStore = useGlobalStore()
|
||||||
|
|
||||||
// console.log('*** autologin_FromLocalStorage ***')
|
console.log('*** autologin_FromLocalStorage ***')
|
||||||
// INIT
|
// INIT
|
||||||
|
|
||||||
let isLogged = false
|
let isLogged = false
|
||||||
@@ -850,7 +852,23 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
this.lang = tools.getItemLS(toolsext.localStorage.lang)
|
this.lang = tools.getItemLS(toolsext.localStorage.lang)
|
||||||
|
|
||||||
const token = localStorage.getItem(toolsext.localStorage.token)
|
const token = localStorage.getItem(toolsext.localStorage.token)
|
||||||
|
|
||||||
if (token) {
|
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
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
isLogged = tools.isLogged()
|
||||||
|
}
|
||||||
|
|
||||||
|
/*if (token) {
|
||||||
const expirationDateStr = localStorage.getItem(toolsext.localStorage.expirationDate)
|
const expirationDateStr = localStorage.getItem(toolsext.localStorage.expirationDate)
|
||||||
const expirationDate = new Date(String(expirationDateStr))
|
const expirationDate = new Date(String(expirationDateStr))
|
||||||
const now = tools.getDateNow()
|
const now = tools.getDateNow()
|
||||||
@@ -900,7 +918,9 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
|
|
||||||
isLogged = true
|
isLogged = true
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return await this.setGlobal($router, isLogged)
|
return await this.setGlobal($router, isLogged)
|
||||||
.then((loadstorage: any) => {
|
.then((loadstorage: any) => {
|
||||||
|
|||||||
@@ -1327,17 +1327,21 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
|||||||
this.mypage = (res.data.mypage) ? [...res.data.mypage] : []
|
this.mypage = (res.data.mypage) ? [...res.data.mypage] : []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let isLogged = false
|
||||||
|
|
||||||
// console.log('res.data.myuser', res.data.myuser)
|
// console.log('res.data.myuser', res.data.myuser)
|
||||||
if (res.data.myuser) {
|
if (res.data.myuser) {
|
||||||
userStore.authUser(res.data.myuser)
|
userStore.authUser(res.data.myuser)
|
||||||
|
|
||||||
userStore.updateLocalStorage(res.data.myuser)
|
userStore.updateLocalStorage(res.data.myuser)
|
||||||
|
|
||||||
|
isLogged = !!res.data.myuser.username
|
||||||
} else {
|
} else {
|
||||||
// User not exist !!
|
// User not exist !!
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const isLogged = localStorage.getItem(toolsext.localStorage.username)
|
// const isLogged = localStorage.getItem(toolsext.localStorage.username)
|
||||||
console.log('isLogged', isLogged)
|
console.log('isLogged', isLogged)
|
||||||
|
|
||||||
// calendarStore.editable = userStore.isAdmin || userStore.isManager || userStore.isTutor
|
// calendarStore.editable = userStore.isAdmin || userStore.isManager || userStore.isTutor
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
<CMyUser
|
<CMyUser
|
||||||
:mycontact="user"
|
:mycontact="user"
|
||||||
:visu="costanti.FIND_PEOPLE"
|
:visu="costanti.FIND_PEOPLE"
|
||||||
@setCmd="setCmd"
|
@setCmd="tools.setCmd"
|
||||||
>
|
>
|
||||||
</CMyUser>
|
</CMyUser>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user