Lista Friends

This commit is contained in:
paoloar77
2022-01-05 19:11:47 +01:00
parent 0997ef1ec3
commit a1f2ced085
46 changed files with 282 additions and 13236 deletions

12
src/validation/email.ts Normal file
View File

@@ -0,0 +1,12 @@
const isEmail = (email: string) => {
const res = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return res.test(String(email).toLowerCase())
// let re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
// return !re.test(fieldValue) ? 'The input is not a valid ' + fieldName + ' address' : '';
}
export function email(email: string) {
return isEmail(email)
}

View File

@@ -4,3 +4,4 @@ export { aportadorexist } from './aportadorexist'
export { registeredemail } from './registeredemail'
export { complexity } from './complexity'
export { alfanum } from './alfanum'
export { email } from './email'

View File

@@ -5,7 +5,7 @@ import { helpers } from '@vuelidate/validators'
const { withAsync } = helpers
// const SITE_URL = GlobalConfig.uri.site
const VALIDATE_USER_URL = process.env.MONGODB_HOST + '/email/'
const VALIDATE_USER_URL = process.env.MONGODB_HOST + '/email/ck'
export const registeredemail = withAsync(_registeredemail)
@@ -15,7 +15,7 @@ export function _registeredemail(email: string) {
return res.status !== PayloadMessageTypes.statusfound
}
return Axios.get(VALIDATE_USER_URL + process.env.APP_ID + '/' + email)
return Axios.post(VALIDATE_USER_URL, {idapp: process.env.APP_ID, email, key: process.env.PAO_APP_ID})
.then(onSuccess)
.catch((err) => {
return true