Commit 05588046 authored by thibaut-felten's avatar thibaut-felten

customization

parent 7ec9a830
frontend/public/favicon.ico

4.19 KB | W: | H:

frontend/public/favicon.ico

15 KB | W: | H:

frontend/public/favicon.ico
frontend/public/favicon.ico
frontend/public/favicon.ico
frontend/public/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title> <title>Not a mahjong</title>
</head> </head>
<body> <body>
<noscript> <noscript>
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
background-image: url('assets/img/panda.jpg'); background-image: url('assets/img/panda.jpg');
background-position-x: right; background-position-x: right;
background-position-y: bottom; background-position-y: bottom;
background-repeat: no-repeat;
background-size: cover;
height: 100vh; height: 100vh;
} }
......
...@@ -2,6 +2,9 @@ let user = { ...@@ -2,6 +2,9 @@ let user = {
token: "", token: "",
name: "", name: "",
id: Math.floor(Math.random() * 1000000 + 1000000), id: Math.floor(Math.random() * 1000000 + 1000000),
first:"",
last:"",
email:"",
win:0, win:0,
lost:0, lost:0,
paper:0, paper:0,
......
...@@ -117,6 +117,7 @@ export default { ...@@ -117,6 +117,7 @@ export default {
user.first = response.data.firstname user.first = response.data.firstname
user.last = response.data.lastname user.last = response.data.lastname
user.email = response.data.email user.email = response.data.email
console.log(user.last)
}) })
.then(this.$router.push("/")) .then(this.$router.push("/"))
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="row _centered"> <div class="row _centered">
<div class="column _600"> <div class="column _600">
<h1>Mise à jour du profil</h1> <h1>Mise à jour du profil</h1>
<form action="post" class="form" v-on:submit.prevent="check"> <form v-if="user.id < 1000000" action="post" class="form" v-on:submit.prevent="check">
<div class="row lmargin"> <div class="row lmargin">
<label for="FirstName"> Prénom </label> <label for="FirstName"> Prénom </label>
<input v-model="firstname" type="text" name="FirstName" > <input v-model="firstname" type="text" name="FirstName" >
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<button type="submit" class="btn"> Valider </button> <button type="submit" class="btn"> Valider </button>
</div> </div>
</form> </form>
<center v-if="user.id >= 1000000">Vous devez être connectés pour changer vos informations...</center>
</div> </div>
</div> </div>
</div> </div>
...@@ -94,20 +95,42 @@ export default { ...@@ -94,20 +95,42 @@ export default {
firstname:"", firstname:"",
lastname:"", lastname:"",
login:"", login:"",
email:"" email:"",
user
} }
}, },
methods: { methods: {
check: function(){ check: function(){
let firstname = this.firstname
let lastname = this.lastname if(this.firstname == ""){
let login = this.login var first = user.first
let email = this.email }else{
first = this.firstname
}
if(this.lastname == ""){
var last = user.last
}else{
last = this.lastname
}
if(this.email == ""){
var mail = user.email
}else{
mail = this.email
}
if(this.login == ""){
var log = user.name
}else{
log = this.login
}
let data = { let data = {
"USER_FIRSTNAME":firstname, "USER_FIRSTNAME":first,
"USER_LASTNAME":lastname, "USER_LASTNAME":last,
"USER_LOGIN":login, "USER_LOGIN":log,
"USER_EMAIL":email "USER_EMAIL":mail
} }
this.call(data) this.call(data)
...@@ -126,14 +149,14 @@ export default { ...@@ -126,14 +149,14 @@ export default {
}, },
body : JSON.stringify(data) }; body : JSON.stringify(data) };
console.log(params.body.lastname)
fetch(url, params) fetch(url, params)
.then(response=>response.json()) .then(() => {
.then(response=> { user.first = data.USER_FIRSTNAME
user.token = response.jwt_token user.last = data.USER_LASTNAME
user.id = response.id user.name = data.USER_LOGIN
}) user.mail = data.USER_EMAIL
})
.then(this.$router.push('/')) .then(this.$router.push('/'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment