Nuovo Sistema di registrazione, Completato.

This commit is contained in:
Paolo Arena
2022-05-05 00:38:26 +02:00
parent dafee01e20
commit b01de2d003
10 changed files with 117 additions and 26 deletions

View File

@@ -3357,14 +3357,14 @@ export const tools = {
}
},
localStSetItem(item: string, value : string) {
localStSetItem(item: string, value: string) {
if (localStorage.getItem('cookie-id') === 'decline')
return null
localStorage.setItem(item, value)
},
localStReal(item: string, value : string) {
localStReal(item: string, value: string) {
localStorage.setItem(item, value)
},
@@ -4557,6 +4557,22 @@ export const tools = {
},
async registeredusername(username: string) {
const VALIDATE_USER_URL = tools.getServerHost() + ''
let onSuccess = (res: AxiosResponse) => {
return res.status === PayloadMessageTypes.statusfound
}
return Axios.get(VALIDATE_USER_URL + '/users/' + process.env.APP_ID + '/' + username)
.then(onSuccess)
.catch((err) => {
return false
})
},
isEmail(email: string) {
const res = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
return res.test(String(email).toLowerCase())
@@ -5359,7 +5375,7 @@ export const tools = {
},
getFieldSearchByTable: function (mytable: string, tablejoin: string, field: string) {
getFieldSearchByTable(mytable: string, tablejoin: string, field: string) {
let ris = field
if (mytable === 'users') {
if (tablejoin === 'cities') {
@@ -5376,6 +5392,22 @@ export const tools = {
return ris
},
getConfSiteOptionEnabled(option: number): any {
const globalStore = useGlobalStore()
if (globalStore.site) {
if (globalStore.site.confsite.hasOwnProperty('options')) {
return this.isBitActive(globalStore.site.confsite.options, option)
}
}
return false
},
getAskToVerifyReg(): boolean {
return this.getConfSiteOptionEnabled(shared_consts.ConfSite.Need_Aportador_On_DataReg_To_Verify_Reg)
},
// getLocale() {

View File

@@ -128,6 +128,11 @@ export const useGlobalStore = defineStore('GlobalStore', {
sectors: [],
sectorgoods: [],
catgrps: [],
site: {
confsite: {
options: 0
},
},
provinces: [],
}),
@@ -1308,6 +1313,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
this.sectorgoods = (res.data.sectorgoods) ? [...res.data.sectorgoods] : []
this.provinces = (res.data.provinces) ? [...res.data.provinces] : []
this.catgrps = (res.data.catgrps) ? [...res.data.catgrps] : []
this.site = (res.data.site) ? res.data.site : {}
this.adtypes = (res.data.adtypes) ? [...res.data.adtypes] : []
this.adtypegoods = (res.data.adtypegoods) ? [...res.data.adtypegoods] : []
@@ -1499,7 +1505,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
let obj = {}
arr.push(this.getItemDate(1, -30, 30, 'Eventi Passati'))
arr.push(this.getItemDate(1, -30, 30, 'Eventi Passati'))
arr.push(this.getItemDate(2, 0, 14, 'Da Oggi a 2 sett.'))
arr.push(this.getItemDate(3, 14, 60, 'Eventi Futuri'))