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
0
Issues
0
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
Thibaut Felten
projet-cdaw
Commits
1ede4162
Commit
1ede4162
authored
Dec 02, 2020
by
thibaut-felten
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LoginNavbar
parent
178f504d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
12 deletions
+19
-12
LoginNavbar.vue
frontend/src/components/LoginNavbar.vue
+8
-7
Accueil.vue
frontend/src/views/Accueil.vue
+1
-1
Login.vue
frontend/src/views/Login.vue
+10
-4
No files found.
frontend/src/components/LoginNavbar.vue
View file @
1ede4162
...
@@ -3,10 +3,10 @@
...
@@ -3,10 +3,10 @@
<button
class=
"btn-login"
>
<button
class=
"btn-login"
>
<router-link
to=
"/"
>
Accueil
</router-link>
<router-link
to=
"/"
>
Accueil
</router-link>
</button>
</button>
<button
class=
"btn-login"
>
<button
class=
"btn-login"
v-if=
"connected"
>
<router-link
to=
"/inscription"
>
Sign Up
</router-link>
<router-link
to=
"/inscription"
>
Sign Up
</router-link>
</button>
</button>
<button
class=
"btn-login"
>
<button
class=
"btn-login"
v-if=
"connected"
>
<router-link
to=
"/login"
>
Log In
</router-link>
<router-link
to=
"/login"
>
Log In
</router-link>
</button>
</button>
...
@@ -17,13 +17,14 @@
...
@@ -17,13 +17,14 @@
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'LoginNavbar'
,
name
:
'LoginNavbar'
,
// components: {
data
(){
// the data, declared as function
// 'v-icon': Icon
return
{
// we return all the properties that should be react on.
// }
connected
:
true
}
},
}
}
// import 'vue-awesome/icons'
// import Icon from 'vue-awesome/components/Icon'
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
...
...
frontend/src/views/Accueil.vue
View file @
1ede4162
...
@@ -43,7 +43,7 @@ export default {
...
@@ -43,7 +43,7 @@ export default {
name
:
'Accueil'
,
name
:
'Accueil'
,
components
:
{
components
:
{
LoginNavbar
LoginNavbar
}
}
,
}
}
import
LoginNavbar
from
'../components/LoginNavbar.vue'
import
LoginNavbar
from
'../components/LoginNavbar.vue'
...
...
frontend/src/views/Login.vue
View file @
1ede4162
...
@@ -76,6 +76,11 @@
...
@@ -76,6 +76,11 @@
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'Login'
,
name
:
'Login'
,
data
(
connect
){
// the data, declared as function
return
{
// we return all the properties that should be react on.
connected
:
connect
}
},
methods
:
{
methods
:
{
check
:
function
(){
check
:
function
(){
let
login
=
this
.
login
let
login
=
this
.
login
...
@@ -101,12 +106,13 @@ export default {
...
@@ -101,12 +106,13 @@ export default {
fetch
(
url
,
params
)
fetch
(
url
,
params
)
.
then
(
response
=>
response
.
json
())
.
then
(
response
=>
response
.
json
())
.
then
(
response
=>
{
.
then
(
data
=>
{
sessionStorage
.
setItem
(
"JWT_TOKEN"
,
response
.
data
.
jwt_token
)
sessionStorage
.
setItem
(
"JWT_TOKEN"
,
data
.
jwt_token
)
console
.
log
(
sessionStorage
.
getItem
(
"JWT_TOKEN"
))
console
.
log
(
sessionStorage
.
getItem
(
"JWT_TOKEN"
))
})
})
let
connect
=
false
console
.
log
(
connect
)
}
}
},
},
...
...
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