Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Projet tutoré S5
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DUCRUET THIBAULT p2306959
Projet tutoré S5
Commits
7d35f7ee
Commit
7d35f7ee
authored
1 year ago
by
Bastien
Browse files
Options
Downloads
Patches
Plain Diff
modif header et page mon compte
parent
3dc128df
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/components/Header.vue
+49
-2
49 additions, 2 deletions
frontend/src/components/Header.vue
frontend/src/views/MonCompte.vue
+36
-7
36 additions, 7 deletions
frontend/src/views/MonCompte.vue
with
85 additions
and
9 deletions
frontend/src/components/Header.vue
+
49
−
2
View file @
7d35f7ee
<
script
setup
>
<
script
setup
>
import
{
ref
,
onMounted
}
from
'
vue
'
;
let
isConnected
=
ref
(
false
);
let
firstname
=
ref
(
''
);
function
checkConnection
()
{
const
req
=
fetch
(
'
http://localhost:3000/user
'
,
{
credentials
:
'
include
'
}).
then
(
response
=>
{
if
(
response
.
ok
)
{
isConnected
.
value
=
true
;
return
response
.
json
();
}
else
{
isConnected
.
value
=
false
;
return
null
;
}
}).
then
(
data
=>
{
if
(
data
)
{
firstname
.
value
=
data
.
firstname
;
}
}).
catch
(
erreur
=>
{
console
.
error
(
'
Erreur lors de l
\'
appel API :
'
,
erreur
);
isConnected
.
value
=
false
;
});
}
function
logout
()
{
const
req
=
fetch
(
'
http://localhost:3000/user/logout
'
,
{
credentials
:
'
include
'
}).
then
(
response
=>
{
if
(
response
.
ok
)
{
isConnected
.
value
=
false
;
}
}).
catch
(
erreur
=>
{
console
.
error
(
'
Erreur lors de l
\'
appel API :
'
,
erreur
);
});
}
onMounted
(()
=>
{
checkConnection
();
});
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -7,8 +51,11 @@
...
@@ -7,8 +51,11 @@
<div>
Projet S5
</div>
<div>
Projet S5
</div>
</router-link>
</router-link>
<nav>
<nav>
<router-link
to=
"/inscription"
>
Inscription
</router-link>
<router-link
v-if=
"!isConnected"
to=
"/inscription"
>
Inscription
</router-link>
<router-link
to=
"/connexion"
>
Connexion
</router-link>
<router-link
v-if=
"!isConnected"
to=
"/connexion"
>
Connexion
</router-link>
<router-link
v-if=
"isConnected"
to=
"/account"
>
Mon compte :
{{
firstname
}}
</router-link>
<button
v-if=
"isConnected"
@
click=
"logout"
>
Déconnexion
</button>
</nav>
</nav>
</header>
</header>
</
template
>
</
template
>
...
...
This diff is collapsed.
Click to expand it.
frontend/src/views/MonCompte.vue
+
36
−
7
View file @
7d35f7ee
<
script
setup
>
<
script
setup
>
import
Header
from
'
@/components/Header.vue
'
import
Header
from
'
@/components/Header.vue
'
import
{
ref
,
onMounted
}
from
'
vue
'
;
let
username
=
ref
(
''
);
let
firstname
=
ref
(
''
);
let
lastname
=
ref
(
''
);
let
birthdate
=
ref
(
''
);
function
getUserInfo
()
{
const
req
=
fetch
(
'
http://localhost:3000/user
'
,
{
credentials
:
'
include
'
}).
then
(
response
=>
{
if
(
response
.
ok
)
{
return
response
.
json
();
}
}).
then
(
data
=>
{
if
(
data
)
{
username
.
value
=
data
.
username
;
firstname
.
value
=
data
.
firstname
;
lastname
.
value
=
data
.
lastname
;
birthdate
.
value
=
data
.
birthdate
;
}
}).
catch
(
erreur
=>
{
console
.
error
(
'
Erreur lors de l
\'
appel API :
'
,
erreur
);
isConnected
.
value
=
false
;
});
}
onMounted
(()
=>
{
getUserInfo
();
});
</
script
>
</
script
>
...
@@ -10,17 +41,15 @@
...
@@ -10,17 +41,15 @@
<h1>
Mes informations
</h1>
<h1>
Mes informations
</h1>
<h3>
Personnelles :
</h3>
<h3>
Personnelles :
</h3>
<h5>
Nom :{last
N
ame}
</h5>
<h5>
Nom :
{
{
last
n
ame
}
}
</h5>
<h5>
Prénom :{name}
</h5>
<h5>
Prénom :
{
{
first
name
}
}
</h5>
<h5>
Date de naissance :
</h5>
<h5>
Date de naissance :
{{
birthdate
}}
</h5>
<h3>
Films préférés :
</h3>
<h3>
Films préférés :
</h3>
<h3>
Sécurité :
</h3>
<h3>
Sécurité :
</h3>
<button>
Changer de mot de login
</button>
<button>
Changer de mot de login
</button>
<br>
<br>
<br>
<br>
<button>
Changer de mot de passe
</button>
<button>
Changer de mot de passe
</button>
</
template
>
</
template
>
<
style
scoped
>
<
style
scoped
></
style
>
</
style
>
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment