2019-02-05 18:17:36 +01:00
|
|
|
import Vue from 'vue'
|
|
|
|
|
import { Component } from 'vue-property-decorator'
|
|
|
|
|
import { UserStore } from '@store'
|
|
|
|
|
import { EventBus, RootState, storeBuilder, DebugMode } from '@store'
|
|
|
|
|
import router from './router'
|
|
|
|
|
|
|
|
|
|
import $ from 'jquery'
|
|
|
|
|
|
|
|
|
|
import Header from './components/Header.vue'
|
|
|
|
|
|
|
|
|
|
import globalroutines from './globalroutines/index'
|
2019-02-08 17:10:25 +01:00
|
|
|
import { GlobalStore } from './store/Modules'
|
2019-02-05 18:17:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
components: {
|
|
|
|
|
appHeader: Header
|
|
|
|
|
},
|
|
|
|
|
router
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default class App extends Vue {
|
|
|
|
|
public backgroundColor = 'whitesmoke'
|
|
|
|
|
public $q
|
|
|
|
|
|
2019-02-14 18:38:23 +01:00
|
|
|
public listaRoutingNoLogin = ['/vreg?', '/offline']
|
2019-02-05 18:17:36 +01:00
|
|
|
|
2019-02-22 10:23:00 +01:00
|
|
|
meta () {
|
|
|
|
|
return {
|
|
|
|
|
keywords: { name: 'keywords', content: 'WebSite' },
|
|
|
|
|
// meta tags
|
|
|
|
|
meta: {
|
|
|
|
|
mykey: { name: 'mykey', content: 'Key 1' },
|
|
|
|
|
keywords: { name: 'keywords', content: 'MyKeywords' }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-05 18:17:36 +01:00
|
|
|
created() {
|
|
|
|
|
if (process.env.DEV) {
|
|
|
|
|
console.info('SESSIONE IN SVILUPPO ! (DEV)')
|
|
|
|
|
console.info(process.env)
|
|
|
|
|
}
|
|
|
|
|
if (process.env.PROD) {
|
|
|
|
|
console.info('SESSIONE IN PRODUZIONE!')
|
2019-02-08 17:10:25 +01:00
|
|
|
// console.info(process.env)
|
2019-02-05 18:17:36 +01:00
|
|
|
}
|
|
|
|
|
|
2019-02-14 18:38:23 +01:00
|
|
|
// Make autologin only if some routing
|
|
|
|
|
|
|
|
|
|
// console.log('window.location.href', window.location.href)
|
|
|
|
|
|
|
|
|
|
let chiamaautologin = true
|
|
|
|
|
this.listaRoutingNoLogin.forEach(mystr => {
|
|
|
|
|
if (window.location.href.includes(mystr)) {
|
|
|
|
|
chiamaautologin = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if (chiamaautologin) {
|
2019-02-27 02:58:41 +01:00
|
|
|
// console.log('CHIAMA autologin_FromLocalStorage')
|
2019-02-14 18:38:23 +01:00
|
|
|
UserStore.actions.autologin_FromLocalStorage()
|
|
|
|
|
.then((loadstorage) => {
|
|
|
|
|
if (loadstorage) {
|
2019-02-16 02:01:17 +01:00
|
|
|
|
2019-02-20 11:53:56 +01:00
|
|
|
if (UserStore.state.lang !== '') {
|
2019-02-27 02:58:41 +01:00
|
|
|
// console.log('SETLOCALE :', this.$i18n.locale)
|
2019-02-19 02:33:02 +01:00
|
|
|
this.$i18n.locale = UserStore.state.lang // Set Lang
|
2019-02-20 11:53:56 +01:00
|
|
|
} else {
|
|
|
|
|
UserStore.mutations.setlang(this.$i18n.locale)
|
2019-02-19 02:33:02 +01:00
|
|
|
}
|
2019-02-27 02:58:41 +01:00
|
|
|
// console.log('lang CARICATO:', this.$i18n.locale)
|
2019-02-16 02:01:17 +01:00
|
|
|
|
2019-02-14 18:38:23 +01:00
|
|
|
globalroutines(this, 'loadapp', '')
|
|
|
|
|
// this.$router.replace('/')
|
2019-02-05 18:17:36 +01:00
|
|
|
|
|
|
|
|
// Create Subscription to Push Notification
|
2019-02-14 18:38:23 +01:00
|
|
|
GlobalStore.actions.createPushSubscription()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
2019-02-05 18:17:36 +01:00
|
|
|
|
2019-02-09 18:04:49 +01:00
|
|
|
// Calling the Server for updates ?
|
|
|
|
|
// Check the verified_email
|
|
|
|
|
|
2019-02-05 18:17:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|