Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projet-cdaw
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Quentin Vrel
projet-cdaw
Commits
a6accf9b
Commit
a6accf9b
authored
Dec 02, 2020
by
quentin.vrel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gvipers.imt-lille-douai.fr/QVrel/projet-cdaw
parents
c340af94
8ab5e523
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
Register.vue
frontend/src/views/Register.vue
+16
-10
No files found.
frontend/src/views/Register.vue
View file @
a6accf9b
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
<pwd-input
id=
"password1"
label=
"Mot de passe"
/>
<pwd-input
id=
"password1"
label=
"Mot de passe"
/>
<pwd-input
id=
"password2"
label=
"Confirmer"
/>
<pwd-input
id=
"password2"
label=
"Confirmer"
/>
<error-message
id=
"error-password"
errormessage=
"Les mots de passe ne correspondent pas."
v-show=
"this.showPwdError"
/>
<error-message
id=
"error-password"
errormessage=
"Les mots de passe ne correspondent pas."
v-show=
"this.showPwdError"
/>
<error-message
id=
"error-mail"
errormessage=
"Le mail rentré n'est pas valide"
v-show=
"this.showMailError"
/>
<error-message
id=
"error-back"
errormessage=
"Cet email ou ce pseudo est déjà pris."
v-show=
"this.showBackError"
/>
<error-message
id=
"error-back"
errormessage=
"Cet email ou ce pseudo est déjà pris."
v-show=
"this.showBackError"
/>
...
@@ -37,13 +38,10 @@ export default {
...
@@ -37,13 +38,10 @@ export default {
return
{
return
{
showPwdError
:
false
,
showPwdError
:
false
,
showBackError
:
false
,
showBackError
:
false
,
showMailError
:
false
,
}
}
},
},
methods
:
{
methods
:
{
updateShowPwdError
:
function
(){
this
.
showPwdError
=
(
document
.
getElementById
(
'password1'
).
value
!==
document
.
getElementById
(
'password2'
).
value
);
},
updateShowBackError
:
function
(){
updateShowBackError
:
function
(){
this
.
showBackError
=
false
;
//TODO
this
.
showBackError
=
false
;
//TODO
},
},
...
@@ -52,6 +50,10 @@ export default {
...
@@ -52,6 +50,10 @@ export default {
if
(
this
.
showPwdError
)
{
if
(
this
.
showPwdError
)
{
return
;
return
;
}
}
this
.
showMailError
=
!
validateEmail
(
document
.
getElementById
(
'mail'
).
value
);
if
(
this
.
showMailError
)
{
return
;
}
this
.
showBackError
=
false
;
//TODO
this
.
showBackError
=
false
;
//TODO
if
(
this
.
showBackError
)
{
if
(
this
.
showBackError
)
{
return
;
return
;
...
@@ -67,12 +69,12 @@ export default {
...
@@ -67,12 +69,12 @@ export default {
'Content-Type'
:
'application/json;charset=utf-8'
'Content-Type'
:
'application/json;charset=utf-8'
},
},
body
:
JSON
.
stringify
({
body
:
JSON
.
stringify
({
login
:
"NEWUSER"
,
login
:
document
.
getElementById
(
'pseudo'
).
value
,
pwd
:
"hashedNEWUSERpwd"
,
pwd
:
document
.
getElementById
(
'password1'
).
value
,
avatar
:
"
avatarnew
.png"
,
avatar
:
"
default
.png"
,
lastname
:
"
NEW
"
,
lastname
:
""
,
firstname
:
"
USER
"
,
firstname
:
""
,
mail
:
"new.user@free.fr"
mail
:
document
.
getElementById
(
'mail'
).
value
})
})
});
//creating the content and sending the request
});
//creating the content and sending the request
...
@@ -84,6 +86,10 @@ export default {
...
@@ -84,6 +86,10 @@ export default {
}
}
}
}
}
}
function
validateEmail
(
email
)
{
const
re
=
/^
[^\s
@
]
+@
[^\s
@
]
+
\.[^\s
@
]
+$/
;
return
re
.
test
(
String
(
email
).
toLowerCase
());
}
</
script
>
</
script
>
<
style
>
<
style
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment