aggiornamenti su PCB
This commit is contained in:
@@ -2040,11 +2040,15 @@ export const tools = {
|
||||
|
||||
getServerHost() {
|
||||
|
||||
const globalStore = useGlobalStore()
|
||||
try {
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
if (globalStore.serverHost) {
|
||||
return globalStore.serverHost
|
||||
} else {
|
||||
if (globalStore.serverHost) {
|
||||
return globalStore.serverHost
|
||||
} else {
|
||||
return globalStore.getServerHost()
|
||||
}
|
||||
} catch (e) {
|
||||
return process.env.MONGODB_HOST
|
||||
}
|
||||
|
||||
@@ -2410,7 +2414,19 @@ export const tools = {
|
||||
},
|
||||
|
||||
isTest() {
|
||||
return process.env.ISTEST === '1'
|
||||
try {
|
||||
return process.env.VUE_APP_ISTEST === '1'
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
},
|
||||
|
||||
isLocale() {
|
||||
try {
|
||||
return process.env.VUE_APP_INLOCALE === '1'
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
},
|
||||
|
||||
notshowPwd(payload: any) {
|
||||
@@ -8087,20 +8103,25 @@ export const tools = {
|
||||
|
||||
globalStore.isAppRunning = displayMode === 'standalone' || globalStore.homescreen
|
||||
} catch (e) {
|
||||
console.log('error navigator.standalone ?!')
|
||||
console.log('error navigator.standalone ?!', e)
|
||||
}
|
||||
|
||||
},
|
||||
initprompt() {
|
||||
// console.log('initprompt')
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
window.addEventListener('beforeinstallprompt', (event) => {
|
||||
event.preventDefault()
|
||||
console.log('beforeinstallprompt !')
|
||||
// Stash the event so it can be triggered later.
|
||||
globalStore.deferredPrompt = event
|
||||
})
|
||||
try {
|
||||
// console.log('initprompt')
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
window.addEventListener('beforeinstallprompt', (event) => {
|
||||
event.preventDefault()
|
||||
console.log('beforeinstallprompt !')
|
||||
// Stash the event so it can be triggered later.
|
||||
globalStore.deferredPrompt = event
|
||||
})
|
||||
} catch (e) {
|
||||
console.error('err', e)
|
||||
}
|
||||
},
|
||||
|
||||
isDevelop() {
|
||||
|
||||
@@ -1513,11 +1513,14 @@ export const useUserStore = defineStore('UserStore', {
|
||||
},
|
||||
|
||||
async setGlobal(router: Router, isLogged: boolean) {
|
||||
console.log('setGlobal', isLogged)
|
||||
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
console.log('setGlobal (logged=', isLogged, ')', globalStore.getServerHost())
|
||||
|
||||
const todos = useTodoStore()
|
||||
const projects = useProjectStore()
|
||||
|
||||
try {
|
||||
// this.isLogged = true
|
||||
if (isLogged) {
|
||||
|
||||
@@ -2053,24 +2053,30 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
|
||||
getServerHost() {
|
||||
|
||||
let myserv = ''
|
||||
// myserv = window.location.host
|
||||
try {
|
||||
let myserv = process.env.MONGODB_HOST!
|
||||
|
||||
if (process.env.DEBUGGING) {
|
||||
myserv = process.env.MONGODB_HOST! // 'http://192.168.1.54:3000'
|
||||
} else {
|
||||
myserv = process.env.MONGODB_HOST!
|
||||
}
|
||||
if (!process.env.DEBUGGING) {
|
||||
if (tools.isTest()) {
|
||||
if (this.site && this.site.host_testapi) {
|
||||
myserv = this.site.host_testapi
|
||||
// console.log('getServerHost TEST API', myserv)
|
||||
}
|
||||
} else {
|
||||
if (this.site && this.site.host_api) {
|
||||
myserv = this.site.host_api
|
||||
// console.log('getServerHost API', myserv)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!myserv) {
|
||||
// if (this.serverHost) {
|
||||
// myserv = this.serverHost
|
||||
// } else {
|
||||
// myserv = process.env.MONGODB_HOST!
|
||||
// }
|
||||
}
|
||||
// console.log('getServerHost', myserv)
|
||||
|
||||
return myserv
|
||||
return myserv
|
||||
} catch (e) {
|
||||
return process.env.MONGODB_HOST
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -2259,7 +2265,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
},
|
||||
|
||||
async loadLastMovements(nummov: number) {
|
||||
return Api.SendReq('/users/lastmovs', 'POST', {nummov})
|
||||
return Api.SendReq('/users/lastmovs', 'POST', { nummov })
|
||||
.then((res) => {
|
||||
if (res.data && res.data.last_transactions && this.datastat) {
|
||||
this.datastat.last_transactions = res.data.last_transactions
|
||||
|
||||
Reference in New Issue
Block a user