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
6bbd568d
Commit
6bbd568d
authored
Dec 01, 2020
by
Robin Borgogno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
création de l'id parti privée
parent
360cdd5f
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
159 additions
and
95 deletions
+159
-95
Game.sql.php
backend/MVC/sql/Game.sql.php
+1
-1
package-lock.json
frontend/package-lock.json
+79
-81
user.js
frontend/src/model/user.js
+25
-0
index.js
frontend/src/router/index.js
+5
-0
Accueil.vue
frontend/src/views/Accueil.vue
+1
-0
AdminPrivate.vue
frontend/src/views/AdminPrivate.vue
+33
-10
ChoixPartie.vue
frontend/src/views/ChoixPartie.vue
+7
-1
Login.vue
frontend/src/views/Login.vue
+8
-2
No files found.
backend/MVC/sql/Game.sql.php
View file @
6bbd568d
...
...
@@ -10,7 +10,7 @@ Game::addSqlQuery('GAME_CREATE',
"INSERT INTO GAME (GAME_ID, GAME_DESC) VALUES (NULL, :GAME_DESC)"
);
Game
::
addSqlQuery
(
'GAME_ID_MAX'
,
"SELECT MAX(GAME_ID) FROM GAME"
);
"SELECT MAX(GAME_ID)
AS id
FROM GAME"
);
Game
::
addSqlQuery
(
'GAME_UPDATE'
,
"UPDATE GAME SET GAME_DESC=:GAME_DESC WHERE GAME_ID=:GAME_ID"
);
...
...
frontend/package-lock.json
View file @
6bbd568d
...
...
@@ -1733,6 +1733,16 @@
"integrity"
:
"sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A=="
,
"dev"
:
true
},
"ansi-styles"
:
{
"version"
:
"4.3.0"
,
"resolved"
:
"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz"
,
"integrity"
:
"sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"color-convert"
:
"^2.0.1"
}
},
"cacache"
:
{
"version"
:
"13.0.1"
,
"resolved"
:
"https://registry.npmjs.org/cacache/-/cacache-13.0.1.tgz"
,
...
...
@@ -1759,6 +1769,34 @@
"unique-filename"
:
"^1.1.1"
}
},
"chalk"
:
{
"version"
:
"4.1.0"
,
"resolved"
:
"https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz"
,
"integrity"
:
"sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"ansi-styles"
:
"^4.1.0"
,
"supports-color"
:
"^7.1.0"
}
},
"color-convert"
:
{
"version"
:
"2.0.1"
,
"resolved"
:
"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz"
,
"integrity"
:
"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"color-name"
:
"~1.1.4"
}
},
"color-name"
:
{
"version"
:
"1.1.4"
,
"resolved"
:
"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz"
,
"integrity"
:
"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
,
"dev"
:
true
,
"optional"
:
true
},
"find-cache-dir"
:
{
"version"
:
"3.3.1"
,
"resolved"
:
"https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz"
,
...
...
@@ -1780,6 +1818,25 @@
"path-exists"
:
"^4.0.0"
}
},
"has-flag"
:
{
"version"
:
"4.0.0"
,
"resolved"
:
"https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz"
,
"integrity"
:
"sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
,
"dev"
:
true
,
"optional"
:
true
},
"loader-utils"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz"
,
"integrity"
:
"sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"big.js"
:
"^5.2.2"
,
"emojis-list"
:
"^3.0.0"
,
"json5"
:
"^2.1.2"
}
},
"locate-path"
:
{
"version"
:
"5.0.0"
,
"resolved"
:
"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz"
,
...
...
@@ -1844,6 +1901,16 @@
"minipass"
:
"^3.1.1"
}
},
"supports-color"
:
{
"version"
:
"7.2.0"
,
"resolved"
:
"https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz"
,
"integrity"
:
"sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"has-flag"
:
"^4.0.0"
}
},
"terser-webpack-plugin"
:
{
"version"
:
"2.3.8"
,
"resolved"
:
"https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.8.tgz"
,
...
...
@@ -1860,6 +1927,18 @@
"terser"
:
"^4.6.12"
,
"webpack-sources"
:
"^1.4.3"
}
},
"vue-loader-v16"
:
{
"version"
:
"npm:vue-loader@16.1.0"
,
"resolved"
:
"https://registry.npmjs.org/vue-loader/-/vue-loader-16.1.0.tgz"
,
"integrity"
:
"sha512-fTtCdI7VeyNK0HP4q4y9Z9ts8TUeaF+2/FjKx8CJ/7/Oem1rCX7zIJe+d+jLrVnVNQjENd3gqmANraLcdRWwnQ=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"chalk"
:
"^4.1.0"
,
"hash-sum"
:
"^2.0.0"
,
"loader-utils"
:
"^2.0.0"
}
}
}
},
...
...
@@ -10906,87 +10985,6 @@
}
}
},
"vue-loader-v16"
:
{
"version"
:
"npm:vue-loader@16.1.0"
,
"resolved"
:
"https://registry.npmjs.org/vue-loader/-/vue-loader-16.1.0.tgz"
,
"integrity"
:
"sha512-fTtCdI7VeyNK0HP4q4y9Z9ts8TUeaF+2/FjKx8CJ/7/Oem1rCX7zIJe+d+jLrVnVNQjENd3gqmANraLcdRWwnQ=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"chalk"
:
"^4.1.0"
,
"hash-sum"
:
"^2.0.0"
,
"loader-utils"
:
"^2.0.0"
},
"dependencies"
:
{
"ansi-styles"
:
{
"version"
:
"4.3.0"
,
"resolved"
:
"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz"
,
"integrity"
:
"sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"color-convert"
:
"^2.0.1"
}
},
"chalk"
:
{
"version"
:
"4.1.0"
,
"resolved"
:
"https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz"
,
"integrity"
:
"sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"ansi-styles"
:
"^4.1.0"
,
"supports-color"
:
"^7.1.0"
}
},
"color-convert"
:
{
"version"
:
"2.0.1"
,
"resolved"
:
"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz"
,
"integrity"
:
"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"color-name"
:
"~1.1.4"
}
},
"color-name"
:
{
"version"
:
"1.1.4"
,
"resolved"
:
"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz"
,
"integrity"
:
"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
,
"dev"
:
true
,
"optional"
:
true
},
"has-flag"
:
{
"version"
:
"4.0.0"
,
"resolved"
:
"https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz"
,
"integrity"
:
"sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
,
"dev"
:
true
,
"optional"
:
true
},
"loader-utils"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz"
,
"integrity"
:
"sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"big.js"
:
"^5.2.2"
,
"emojis-list"
:
"^3.0.0"
,
"json5"
:
"^2.1.2"
}
},
"supports-color"
:
{
"version"
:
"7.2.0"
,
"resolved"
:
"https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz"
,
"integrity"
:
"sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"has-flag"
:
"^4.0.0"
}
}
}
},
"vue-router"
:
{
"version"
:
"3.4.9"
,
"resolved"
:
"https://registry.npmjs.org/vue-router/-/vue-router-3.4.9.tgz"
,
...
...
frontend/src/model/user.js
0 → 100644
View file @
6bbd568d
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
}
}
\ No newline at end of file
frontend/src/router/index.js
View file @
6bbd568d
...
...
@@ -34,6 +34,11 @@ const routes = [
path
:
'/choixPartie'
,
name
:
'ChoixPartie'
,
component
:
()
=>
import
(
/* webpackChunkName: "login" */
'../views/ChoixPartie.vue'
)
},
{
path
:
"/adminPrivate"
,
name
:
"AdminPrivate"
,
component
:
()
=>
import
(
/* webpackChunkName: "login" */
'../views/AdminPrivate.vue'
)
}
]
...
...
frontend/src/views/Accueil.vue
View file @
6bbd568d
...
...
@@ -40,6 +40,7 @@
<
script
>
export
default
{
name
:
'Accueil'
,
components
:
{
LoginNavbar
...
...
frontend/src/views/AdminPrivate.vue
View file @
6bbd568d
...
...
@@ -2,15 +2,13 @@
<div
class=
"inscription"
>
<div
class=
"row _centered"
>
<div
class=
"column _600"
>
<form
method=
"post"
class=
"startGame"
>
<div
class=
"codeGame"
>
<label
class=
"titre"
>
Code de la partie :
</label
>
<!-- Choper le code de la partie privée --
>
<h1
class=
"titre"
>
Code de la partie :
</h1
>
<h1
class=
"titre"
id=
"codeGame"
>
{{
idGame
()
}}
</h1
>
</div>
<div
class=
"joueurs"
>
<!-- ajoute les joueurs présent -->
</div>
</form>
</div>
</div>
</div>
...
...
@@ -27,3 +25,28 @@
height
:
90%
;
}
</
style
>
<
script
>
export
default
{
name
:
'AdminPrivate'
,
methods
:
{
idGame
:
function
(){
const
url
=
"http://localhost/felten/projet-cdaw/backend/MVC/api.php/game"
let
data
=
{
"GAME_DESC"
:
"testHTML"
}
var
params
=
{
method
:
'POST'
,
body
:
JSON
.
stringify
(
data
)
};
fetch
(
url
,
params
)
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
document
.
getElementById
(
"codeGame"
).
innerHTML
=
data
[
0
].
id
})
},
},
}
</
script
>
\ No newline at end of file
frontend/src/views/ChoixPartie.vue
View file @
6bbd568d
...
...
@@ -74,3 +74,9 @@
}
</
style
>
<
script
>
export
default
{
name
:
'ChoixPartie'
,
}
</
script
>
\ No newline at end of file
frontend/src/views/Login.vue
View file @
6bbd568d
...
...
@@ -73,6 +73,8 @@
</
style
>
<
script
>
export
default
{
name
:
'Login'
,
methods
:
{
...
...
@@ -86,7 +88,7 @@ export default {
},
call
:
function
(
login
,
password
){
const
url
=
"http://localhost/projet-cdaw/backend/MVC/api.php/login"
const
url
=
"http://localhost/
felten/
projet-cdaw/backend/MVC/api.php/login"
let
data
=
{
login
:
login
,
...
...
@@ -102,7 +104,11 @@ export default {
fetch
(
url
,
params
)
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
console
.
log
(
data
))
.
then
(
data
=>
{
sessionStorage
.
setItem
(
"JWT_TOKEN"
,
data
.
jwt_token
)
console
.
log
(
sessionStorage
.
getItem
(
"JWT_TOKEN"
))
console
.
log
(
data
)
})
}
...
...
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