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
21661ffb
Commit
21661ffb
authored
Dec 02, 2020
by
thibaut-felten
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gvipers.imt-lille-douai.fr/thibaut.felten/projet-cdaw
into master
parents
dc34d72e
585bc870
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
33 deletions
+73
-33
game.js
frontend/src/model/game.js
+4
-0
user.js
frontend/src/model/user.js
+0
-26
AdminPrivate.vue
frontend/src/views/AdminPrivate.vue
+60
-7
Inscription.vue
frontend/src/views/Inscription.vue
+4
-0
Login.vue
frontend/src/views/Login.vue
+5
-0
No files found.
frontend/src/model/game.js
0 → 100644
View file @
21661ffb
let
game
=
{
id
:
0
}
module
.
exports
=
game
\ No newline at end of file
frontend/src/model/user.js
View file @
21661ffb
// export default class user {
// token = "";
// id = 0;
// putId(id)
// {
// this.id = id
// }
// getId()
// {
// return this.id
// }
// putToken(token)
// {
// this.token = token
// }
// getToken()
// {
// return this.token
// }
// }
let
user
=
{
token
:
""
,
id
:
0
...
...
frontend/src/views/AdminPrivate.vue
View file @
21661ffb
...
...
@@ -4,11 +4,11 @@
<div
class=
"row _centered"
>
<div
class=
"column _600"
>
<div
class=
"codeGame"
>
<h1
class=
"titre"
>
Code de la partie :
{{
returnID
()
}}
</h1>
<h1
class=
"titre"
id=
"codeGame"
>
{{
idGame
()
}}{{
return
ID
()
}}
</h1>
<h1
class=
"titre"
>
Code de la partie :
</h1>
<h1
class=
"titre"
id=
"codeGame"
>
{{
game
ID
()
}}
</h1>
</div>
<div
class=
"joueurs"
>
<!-- ajoute les joueurs présent -->
{{
JoueurPresent
()
}}
</div>
</div>
</div>
...
...
@@ -29,10 +29,11 @@
<
script
>
const
user
=
require
(
"../model/user.js"
)
const
game
=
require
(
"../model/game.js"
)
export
default
{
name
:
'AdminPrivate'
,
methods
:
{
i
dGame
:
function
(){
createI
dGame
:
function
(){
const
url
=
"http://localhost/felten/projet-cdaw/backend/MVC/api.php/game"
let
data
=
{
...
...
@@ -43,22 +44,74 @@ export default {
method
:
'POST'
,
body
:
JSON
.
stringify
(
data
)
};
console
.
log
(
user
)
//
console.log(user)
fetch
(
url
,
params
)
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
document
.
getElementById
(
"codeGame"
).
innerHTML
=
data
[
0
].
id
document
.
getElementById
(
"codeGame"
).
innerHTML
=
data
[
0
].
id
;
game
.
id
=
data
[
0
].
id
;
console
.
log
(
game
.
id
)
})
},
returnID
:
function
(){
gameID
:
function
(){
this
.
createIdGame
()
this
.
ajoutAdminGame
()
},
returnUserID
:
function
(){
return
user
.
id
},
returnGameID
:
function
(){
return
game
.
id
},
ajoutAdminGame
:
function
(){
const
url
=
"http://localhost/felten/projet-cdaw/backend/MVC/api.php/gameuser"
console
.
log
(
this
.
returnUserID
())
console
.
log
(
this
.
returnGameID
())
let
data
=
{
"GAME_ID"
:
this
.
returnGameID
(),
"USER_ID"
:
this
.
returnUserID
()
}
var
params
=
{
method
:
'POST'
,
body
:
JSON
.
stringify
(
data
)
};
fetch
(
url
,
params
)
.
then
(
response
=>
response
.
json
())
},
JoueurPresent
:
function
(){
let
url
=
"http://localhost/felten/projet-cdaw/backend/MVC/api.php/gameuser/game"
url
+=
"/"
+
game
.
id
;
var
params
=
{
method
:
"GET"
}
fetch
(
url
,
params
)
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
console
.
log
(
data
)
let
text
;
data
.
forEach
(
user
=>
{
text
+=
"<h2 class='joueur' id='joueur'>"
+
user
.
USER_ID
+
"</h2>"
});
document
.
getElementById
(
"joueurs"
).
innerHTML
=
text
})
}
<<<<<<<
HEAD
},
components
:
{
LoginNavbar
},
}
=======
},
components
:{
LoginNavbar
}
}
>>>>>>>
97
c6d41dc424575a3414673ca6d5e508e1423274
import
LoginNavbar
from
'../components/LoginNavbar.vue'
</
script
>
\ No newline at end of file
frontend/src/views/Inscription.vue
View file @
21661ffb
...
...
@@ -148,6 +148,9 @@ export default {
fetch
(
url
,
params
)
.
then
(
response
=>
response
.
json
())
<<<<<<<
HEAD
.
then
(
data
=>
console
.
log
(
data
))
=======
.
then
(
response
=>
{
user
.
token
=
response
.
jwt_token
user
.
id
=
response
.
id
...
...
@@ -155,6 +158,7 @@ export default {
.
then
(
this
.
$router
.
push
(
'/'
))
>>>>>>>
97
c6d41dc424575a3414673ca6d5e508e1423274
}
},
...
...
frontend/src/views/Login.vue
View file @
21661ffb
...
...
@@ -87,8 +87,13 @@ export default {
},
methods
:
{
check
:
function
(){
<<<<<<<
HEAD
let
login
=
this
.
login
let
password
=
this
.
password
=======
let
login
=
this
.
log
let
password
=
this
.
pass
>>>>>>>
97
c6d41dc424575a3414673ca6d5e508e1423274
var
bcrypt
=
require
(
'bcryptjs'
);
var
salt
=
"$2a$08$c0GzKSB8g6.rZLF98GJvQu"
var
hash
=
bcrypt
.
hashSync
(
password
,
salt
)
...
...
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