- updated SendReq
- If Server Down the login msg error corrected.
This commit is contained in:
@@ -77,6 +77,11 @@ export default class Signin extends Vue {
|
||||
} else if (riscode === serv_constants.RIS_CODE_LOGIN_ERR) {
|
||||
this.showNotif(this.$t('login.errato'))
|
||||
this.$router.push('/signin')
|
||||
} else if (riscode === rescodes.ERR_SERVERFETCH) {
|
||||
this.showNotif(this.$t('fetch.errore_server'))
|
||||
} else if (riscode === rescodes.ERR_GENERICO) {
|
||||
let msg = this.$t('fetch.errore_generico') + UserStore.mutations.getMsgError(riscode)
|
||||
this.showNotif(msg)
|
||||
} else {
|
||||
this.showNotif('Errore num ' + riscode)
|
||||
}
|
||||
@@ -117,6 +122,7 @@ export default class Signin extends Vue {
|
||||
console.log(this.signin)
|
||||
UserStore.actions.signin(this.signin)
|
||||
.then((riscode) => {
|
||||
console.log('riscode=', riscode)
|
||||
if (riscode === rescodes.OK) {
|
||||
router.push('/signin')
|
||||
globalroutines(this, 'loadapp', '')
|
||||
@@ -127,6 +133,8 @@ export default class Signin extends Vue {
|
||||
this.$q.loading.hide()
|
||||
}).catch(error => {
|
||||
console.log('ERROR = ' + error)
|
||||
|
||||
this.checkErrors(error)
|
||||
this.$q.loading.hide()
|
||||
})
|
||||
|
||||
|
||||
@@ -8,52 +8,54 @@
|
||||
</div>
|
||||
|
||||
<!--Prova URL : {{env('PROVA_PAOLO')}}-->
|
||||
<form>
|
||||
|
||||
<q-field
|
||||
:error="$v.signin.username.$error"
|
||||
:error-label="`${errorMsg('username', $v.signin.username)}`"
|
||||
>
|
||||
<q-input
|
||||
v-model="signin.username"
|
||||
autocomplete="username"
|
||||
@change="val => { signin.username = val }"
|
||||
:before="[{icon: 'person', handler () {}}]"
|
||||
@blur="$v.signin.username.$touch"
|
||||
<q-field
|
||||
:error="$v.signin.username.$error"
|
||||
:float-label="$t('reg.username')"></q-input>
|
||||
</q-field>
|
||||
:error-label="`${errorMsg('username', $v.signin.username)}`"
|
||||
>
|
||||
<q-input
|
||||
v-model="signin.username"
|
||||
autocomplete="username"
|
||||
@change="val => { signin.username = val }"
|
||||
:before="[{icon: 'person', handler () {}}]"
|
||||
@blur="$v.signin.username.$touch"
|
||||
:error="$v.signin.username.$error"
|
||||
:float-label="$t('reg.username')"></q-input>
|
||||
</q-field>
|
||||
|
||||
<q-field
|
||||
:error="$v.signin.password.$error"
|
||||
:error-label="`${errorMsg('password', $v.signin.password)}`"
|
||||
>
|
||||
<q-input
|
||||
v-model="signin.password"
|
||||
type="password"
|
||||
:before="[{icon: 'vpn_key', handler () {}}]"
|
||||
@blur="$v.signin.password.$touch"
|
||||
<q-field
|
||||
:error="$v.signin.password.$error"
|
||||
:float-label="$t('reg.password')"></q-input>
|
||||
</q-field>
|
||||
:error-label="`${errorMsg('password', $v.signin.password)}`"
|
||||
>
|
||||
<q-input
|
||||
v-model="signin.password"
|
||||
type="password"
|
||||
:before="[{icon: 'vpn_key', handler () {}}]"
|
||||
@blur="$v.signin.password.$touch"
|
||||
:error="$v.signin.password.$error"
|
||||
:float-label="$t('reg.password')"></q-input>
|
||||
</q-field>
|
||||
|
||||
<div>
|
||||
<a :href="getlinkforgetpwd">{{$t('reg.forgetpassword')}}</a>
|
||||
</div>
|
||||
<div>
|
||||
<a :href="getlinkforgetpwd">{{$t('reg.forgetpassword')}}</a>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<q-card-main class="flex flex-center">
|
||||
<!--<q-btn v-if="$myconfig.socialLogin.facebook" :loading="loading" class="q-mb-md q-mr-md" rounded icon="fab fa-facebook-f" size="sm" color="blue-10" text-color="white" @click="facebook" :label="$t('components.authentication.login.facebook')"/>-->
|
||||
<!--
|
||||
<q-btn v-if="$myconfig.socialLogin.facebook" class="q-mb-md q-mr-md" rounded icon="fab fa-facebook-f" size="sm" color="blue-10" text-color="white" @click="facebook" :label="$t('components.authentication.login.facebook')"/>
|
||||
<q-btn v-if="$myconfig.socialLogin.google" class="q-mb-md q-mr-md" rounded icon="fab fa-google" size="sm" color="deep-orange-14" text-color="white" @click="google" :label="$t('components.authentication.login.google')"/>
|
||||
-->
|
||||
</q-card-main>
|
||||
<q-card-main class="flex flex-center">
|
||||
<!--<q-btn v-if="$myconfig.socialLogin.facebook" :loading="loading" class="q-mb-md q-mr-md" rounded icon="fab fa-facebook-f" size="sm" color="blue-10" text-color="white" @click="facebook" :label="$t('components.authentication.login.facebook')"/>-->
|
||||
<!--
|
||||
<q-btn v-if="$myconfig.socialLogin.facebook" class="q-mb-md q-mr-md" rounded icon="fab fa-facebook-f" size="sm" color="blue-10" text-color="white" @click="facebook" :label="$t('components.authentication.login.facebook')"/>
|
||||
<q-btn v-if="$myconfig.socialLogin.google" class="q-mb-md q-mr-md" rounded icon="fab fa-google" size="sm" color="deep-orange-14" text-color="white" @click="google" :label="$t('components.authentication.login.google')"/>
|
||||
-->
|
||||
</q-card-main>
|
||||
|
||||
<div align="center">
|
||||
<q-btn rounded size="lg" color="primary" @click="submit" :disable="$v.$error">{{$t('login.enter')}}
|
||||
</q-btn>
|
||||
</div>
|
||||
<div align="center">
|
||||
<q-btn rounded size="lg" color="primary" @click="submit" :disable="$v.$error">{{$t('login.enter')}}
|
||||
</q-btn>
|
||||
</div>
|
||||
</form>
|
||||
</q-page>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -124,11 +124,16 @@ export default class Signup extends Vue {
|
||||
}
|
||||
|
||||
checkErrors(riscode: number) {
|
||||
// console.log("RIS = " + riscode);
|
||||
console.log('checkErrors', riscode)
|
||||
if (riscode === rescodes.DUPLICATE_EMAIL_ID) {
|
||||
this.showNotif(this.$t('reg.err.duplicate_email'))
|
||||
} else if (riscode === rescodes.DUPLICATE_USERNAME_ID) {
|
||||
this.showNotif(this.$t('reg.err.duplicate_username'))
|
||||
} else if (riscode === rescodes.ERR_SERVERFETCH) {
|
||||
this.showNotif(this.$t('fetch.errore_server'))
|
||||
} else if (riscode === rescodes.ERR_GENERICO) {
|
||||
let msg = this.$t('fetch.errore_generico') + UserStore.mutations.getMsgError(riscode)
|
||||
this.showNotif(msg)
|
||||
} else if (riscode === rescodes.OK) {
|
||||
this.$router.push('/signin')
|
||||
this.showNotif({type: 'warning', textColor: 'black', message: this.$t('components.authentication.email_verification.link_sent')})
|
||||
@@ -136,6 +141,8 @@ export default class Signup extends Vue {
|
||||
this.showNotif('Errore num ' + riscode)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public submitOk() {
|
||||
|
||||
Reference in New Issue
Block a user