Forget Password e Update Password (1)
This commit is contained in:
@@ -62,33 +62,6 @@ export default defineComponent({
|
||||
return '/requestresetpwd'
|
||||
}
|
||||
|
||||
function errorMsg(cosa: string, item: any) {
|
||||
/*
|
||||
try {
|
||||
if (!item.$error) {
|
||||
return ''
|
||||
}
|
||||
if (item.$params.email && !item.email) {
|
||||
return t('reg.err.email')
|
||||
}
|
||||
|
||||
if (!item.required) {
|
||||
return t('reg.err.required')
|
||||
}
|
||||
if (!item.minLength) {
|
||||
return t('reg.err.atleast') + ' ${item.$params.minLength.min} ' + t('reg.err.char')
|
||||
}
|
||||
if (!item.maxLength) {
|
||||
return t('reg.err.notmore') + ` ${item.$params.maxLength.max} ` + t('reg.err.char')
|
||||
}
|
||||
return ''
|
||||
} catch (err) {
|
||||
// console.log("ERR : " + error);
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
function isError() {
|
||||
if (refUsername.value) {
|
||||
// @ts-ignore
|
||||
@@ -172,7 +145,6 @@ export default defineComponent({
|
||||
refUsername,
|
||||
onReset,
|
||||
onSubmit,
|
||||
errorMsg,
|
||||
signin,
|
||||
getlinkforgetpwd,
|
||||
myForm,
|
||||
|
||||
@@ -87,74 +87,6 @@ export default defineComponent({
|
||||
return process.env
|
||||
}
|
||||
|
||||
function errorMsg(cosa: string, item: any) {
|
||||
try {
|
||||
if (!item.$error) {
|
||||
return ''
|
||||
}
|
||||
console.log('errorMsg', cosa, item)
|
||||
|
||||
if (cosa === 'repeatpassword') {
|
||||
if (!item.sameAsPassword) {
|
||||
return t('reg.err.sameaspassword')
|
||||
}
|
||||
}
|
||||
|
||||
if (item.email) {
|
||||
if (item.email.$invalid)
|
||||
return t('reg.err.email')
|
||||
}
|
||||
|
||||
if (item.minLength !== undefined) {
|
||||
if (item.minLength.$invalid) {
|
||||
return t('reg.err.atleast') + ` ${item.minLength.$params.min} ` + t('reg.err.char')
|
||||
}
|
||||
}
|
||||
if (item.complexity !== undefined) {
|
||||
if (item.complexity.$invalid) {
|
||||
return t('reg.err.complexity')
|
||||
}
|
||||
}
|
||||
// if (!item.maxLength) { return t('reg.err.notmore') + ` ${item.$params.maxLength.max} ` + t('reg.err.char') }
|
||||
|
||||
if (item.required !== undefined) {
|
||||
if (item.required.$invalid) {
|
||||
console.log('required')
|
||||
return t('reg.err.required')
|
||||
}
|
||||
}
|
||||
|
||||
console.log(' cosa', cosa)
|
||||
|
||||
// console.log(' ....avanti')
|
||||
if (cosa === 'email') {
|
||||
// console.log("EMAIL " + item.isUnique);
|
||||
// console.log(item);
|
||||
if (!item.email.$invalid) {
|
||||
return t('reg.err.duplicate_email')
|
||||
}
|
||||
} else if (cosa === 'username') {
|
||||
// console.log(item);
|
||||
console.log('username')
|
||||
console.log(item.$error)
|
||||
if (!item.registereduser.$invalid) {
|
||||
return t('reg.err.duplicate_username')
|
||||
}
|
||||
} else if (cosa === 'aportador_solidario') {
|
||||
// console.log(item);
|
||||
if (!item.aportadorexist) {
|
||||
// console.log('!item.aportadorexist !')
|
||||
return t('reg.err.aportador_not_exist')
|
||||
}
|
||||
} else if ((cosa === 'name') || (cosa === 'surname')) {
|
||||
// console.log(item);
|
||||
}
|
||||
|
||||
return ''
|
||||
} catch (error) {
|
||||
// console.log("ERR : " + error);
|
||||
}
|
||||
}
|
||||
|
||||
function changeemail() {
|
||||
signup.email = tools.removespaces(signup.email!)
|
||||
@@ -223,7 +155,6 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
return {
|
||||
errorMsg,
|
||||
changeemail,
|
||||
changeusername,
|
||||
submitOk,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
@blur="v$.email.$touch"
|
||||
@input="changeemail()"
|
||||
:error="v$.email.$error"
|
||||
:error-message="errorMsg('email', v$.email)"
|
||||
:error-message="tools.errorMsg( 'email', v$.email)"
|
||||
maxlength="50"
|
||||
debounce="3000"
|
||||
:label="$t('reg.email')">
|
||||
@@ -36,7 +36,7 @@
|
||||
@keydown.space="(event) => event.preventDefault()"
|
||||
maxlength="20"
|
||||
debounce="1000"
|
||||
:error-message="errorMsg('username', v$.username)"
|
||||
:error-message="tools.errorMsg( 'username', v$.username)"
|
||||
:label="$t('reg.username')">
|
||||
|
||||
<template v-slot:prepend>
|
||||
@@ -52,7 +52,7 @@
|
||||
:error="v$.name.$error"
|
||||
maxlength="30"
|
||||
debounce="1000"
|
||||
:error-message="errorMsg('name', v$.name)"
|
||||
:error-message="tools.errorMsg( 'name', v$.name)"
|
||||
:label="$t('reg.name')">
|
||||
|
||||
<template v-slot:prepend>
|
||||
@@ -68,7 +68,7 @@
|
||||
@blur="v$.surname.$touch"
|
||||
maxlength="30"
|
||||
debounce="1000"
|
||||
:error-message="errorMsg('surname', v$.surname)"
|
||||
:error-message="tools.errorMsg( 'surname', v$.surname)"
|
||||
:label="$t('reg.surname')">
|
||||
|
||||
<template v-slot:prepend>
|
||||
@@ -83,7 +83,7 @@
|
||||
rounded outlined
|
||||
@blur="v$.password.$touch"
|
||||
:error="v$.password.$error"
|
||||
:error-message="`${errorMsg('password', v$.password)}`"
|
||||
:error-message="`${tools.errorMsg( 'password', v$.password)}`"
|
||||
maxlength="30"
|
||||
debounce="1000"
|
||||
:label="$t('reg.password')">
|
||||
@@ -101,7 +101,7 @@
|
||||
rounded outlined
|
||||
@blur="v$.repeatPassword.$touch"
|
||||
:error="v$.repeatPassword.$error"
|
||||
:error-message="`${errorMsg('repeatpassword', v$.repeatPassword)}`"
|
||||
:error-message="`${tools.errorMsg( 'repeatpassword', v$.repeatPassword)}`"
|
||||
|
||||
:label="$t('reg.repeatPassword')">
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
color="secondary"
|
||||
@blur="v$.terms.$touch"
|
||||
:error="v$.terms.$error"
|
||||
:error-message="`${errorMsg('terms', v$.terms)}`"
|
||||
:error-message="`${tools.errorMsg( 'terms', v$.terms)}`"
|
||||
:label="$t('reg.terms')">
|
||||
|
||||
</q-checkbox>
|
||||
|
||||
Reference in New Issue
Block a user