- SignIn component. Added also in the Toolbar (Header.ts)
This commit is contained in:
@@ -3,6 +3,7 @@ import Component from 'vue-class-component'
|
||||
|
||||
import drawer from '../../layouts/drawer/drawer.vue'
|
||||
import messagePopover from '../../layouts/toolbar/messagePopover/messagePopover.vue'
|
||||
import { CSignIn } from '../../components/CSignIn'
|
||||
|
||||
import { GlobalStore, UserStore } from '@modules'
|
||||
// import { StateConnection } from '../../model'
|
||||
@@ -12,12 +13,13 @@ import { toolsext } from '@src/store/Modules/toolsext'
|
||||
|
||||
import Quasar, { Screen } from 'quasar'
|
||||
import { static_data } from '../../db/static_data'
|
||||
import globalroutines from '../../globalroutines'
|
||||
|
||||
@Component({
|
||||
name: 'Header',
|
||||
components: {
|
||||
drawer,
|
||||
messagePopover
|
||||
messagePopover, CSignIn
|
||||
}
|
||||
})
|
||||
|
||||
@@ -330,11 +332,11 @@ export default class Header extends Vue {
|
||||
public logoutHandler() {
|
||||
UserStore.actions.logout()
|
||||
.then(() => {
|
||||
this.$router.replace('/logout')
|
||||
|
||||
setTimeout(() => {
|
||||
this.$router.replace('/')
|
||||
}, 1000)
|
||||
// this.$router.replace('/logout')
|
||||
//
|
||||
// setTimeout(() => {
|
||||
// this.$router.replace('/')
|
||||
// }, 1000)
|
||||
|
||||
tools.showNotif(this.$q, this.$t('logout.uscito'), {icon: 'exit_to_app'})
|
||||
})
|
||||
@@ -347,4 +349,24 @@ export default class Header extends Vue {
|
||||
get isLogged() {
|
||||
return UserStore.state.isLogged
|
||||
}
|
||||
|
||||
public loginOk() {
|
||||
tools.loginOk(this, false)
|
||||
}
|
||||
|
||||
public loginInCorso() {
|
||||
tools.loginInCorso(this)
|
||||
}
|
||||
|
||||
public checkErrors(riscode) {
|
||||
tools.checkErrors(this, riscode)
|
||||
}
|
||||
|
||||
public showNotif(msgcode) {
|
||||
tools.showNotif(this.$q, this.$t(msgcode))
|
||||
}
|
||||
|
||||
public mythis() {
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,10 +137,13 @@
|
||||
<q-avatar class="q-mb-sm center_img">
|
||||
<img src="../../statics/images/avatar-1.svg">
|
||||
</q-avatar>
|
||||
<q-btn class="absolute-top-right" style="margin-top: 9px; margin-right: 12px; color: white;" dense flat round icon="close" @click="right = !right">
|
||||
<q-btn class="absolute-top-right" style="margin-top: 9px; margin-right: 12px; color: white;"
|
||||
dense flat round icon="close" @click="right = !right">
|
||||
</q-btn>
|
||||
<div v-if="Username" class="text-weight-bold text-user">{{ Username }} - {{ myName }}</div>
|
||||
<div v-else class="text-italic">{{ $t('user.loggati') }}</div>
|
||||
<div v-else class="text-italic">
|
||||
{{ $t('user.loggati') }}
|
||||
</div>
|
||||
|
||||
<!--<span class="text-white" v-if="Verificato"> {{$t('reg.verificato')}} </span>-->
|
||||
<!--<span class="text-white background-red" v-else> {{$t('reg.non_verificato')}} </span>-->
|
||||
@@ -153,6 +156,18 @@
|
||||
|
||||
</div>
|
||||
</q-img>
|
||||
<div style="margin-top:120px;"></div>
|
||||
<div v-show="!Username">
|
||||
<div class="q-ma-md" style="">
|
||||
<CSignIn :mythis="mythis"
|
||||
@loginOk="loginOk"
|
||||
@loginInCorso="loginInCorso"
|
||||
@checkErrors="checkErrors"
|
||||
@showNotif="showNotif">
|
||||
</CSignIn>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</q-drawer>
|
||||
|
||||
Reference in New Issue
Block a user