Commit e56aca59 authored by raphael.peim's avatar raphael.peim

Update router

parent ee3390db
...@@ -1788,6 +1788,16 @@ ...@@ -1788,6 +1788,16 @@
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
"dev": true "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": { "cacache": {
"version": "13.0.1", "version": "13.0.1",
"resolved": "https://registry.npmjs.org/cacache/-/cacache-13.0.1.tgz", "resolved": "https://registry.npmjs.org/cacache/-/cacache-13.0.1.tgz",
...@@ -1814,6 +1824,34 @@ ...@@ -1814,6 +1824,34 @@
"unique-filename": "^1.1.1" "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": { "find-cache-dir": {
"version": "3.3.1", "version": "3.3.1",
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz",
...@@ -1835,6 +1873,25 @@ ...@@ -1835,6 +1873,25 @@
"path-exists": "^4.0.0" "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": { "locate-path": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
...@@ -1899,6 +1956,16 @@ ...@@ -1899,6 +1956,16 @@
"minipass": "^3.1.1" "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": { "terser-webpack-plugin": {
"version": "2.3.8", "version": "2.3.8",
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.8.tgz", "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.8.tgz",
...@@ -1915,6 +1982,18 @@ ...@@ -1915,6 +1982,18 @@
"terser": "^4.6.12", "terser": "^4.6.12",
"webpack-sources": "^1.4.3" "webpack-sources": "^1.4.3"
} }
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.0.0",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0.tgz",
"integrity": "sha512-R20f4PWe34dqhTZ9tkyFd6nfjxEbLBHbFOsN38qg0Jl8GKMfmoyc/E8vVjjRkunE6qCydpPoH7f/tW13bD6+JA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
} }
} }
}, },
...@@ -11349,87 +11428,6 @@ ...@@ -11349,87 +11428,6 @@
} }
} }
}, },
"vue-loader-v16": {
"version": "npm:vue-loader@16.0.0-rc.2",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-rc.2.tgz",
"integrity": "sha512-cz8GK4dgIf1UTC+do80pGvh8BHcCRHLIQVHV9ONVQ8wtoqS9t/+H02rKcQP+TVNg7khgLyQV2+8eHUq7/AFq3g==",
"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": { "vue-router": {
"version": "3.4.9", "version": "3.4.9",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.4.9.tgz", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.4.9.tgz",
......
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router" target="_blank" rel="noopener">router</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
:type="information.type" :type="information.type"
:id="information.id" :id="information.id"
:placeholder="information.placeholder" :placeholder="information.placeholder"
autocomplete="off"
required> required>
<!-- :pattern="information.pattern" --> <!-- :pattern="information.pattern" -->
</div> </div>
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
<div id="navbar"> <div id="navbar">
<!-- primary, success, info, warning, danger, dark, or light --> <!-- primary, success, info, warning, danger, dark, or light -->
<b-navbar toggleable="lg" type="dark" variant="primary"> <b-navbar toggleable="lg" type="dark" variant="primary">
<router-link to="/"><b-navbar-brand>Mahjong</b-navbar-brand></router-link> <router-link to="/home"><b-navbar-brand>Mahjong</b-navbar-brand></router-link>
<b-navbar-toggle target="nav-collapse"></b-navbar-toggle> <b-navbar-toggle target="nav-collapse"></b-navbar-toggle>
<b-collapse id="nav-collapse" is-nav> <b-collapse id="nav-collapse" is-nav>
<b-navbar-nav class="ml-auto"> <b-navbar-nav class="ml-auto">
<b-navbar-nav> <b-navbar-nav>
<b-nav-item href="/">Accueil</b-nav-item> <b-nav-item href="/#/home">Accueil</b-nav-item>
</b-navbar-nav> </b-navbar-nav>
<b-nav-item-dropdown text="Jeu" right> <b-nav-item-dropdown text="Jeu" right>
...@@ -39,11 +39,8 @@ ...@@ -39,11 +39,8 @@
components: {}, components: {},
methods: { methods: {
onClick() { onClick() {
const href = window.location.href; if (confirm("Etes-vous sûr de vouloir vous déconnecter ?"))
const url = href.substring(0, href.lastIndexOf('/')) + '/' window.location.href = '/#/'
if (confirm("Etes-vous sür de vouloir vous déconnecter ?"))
window.location.href = url
} }
} }
}; };
......
...@@ -10,7 +10,7 @@ Vue.use(BootstrapVue) ...@@ -10,7 +10,7 @@ Vue.use(BootstrapVue)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$hostname = Vue.config.productionTip ? 'https://hostname' : 'http://localhost:8080' Vue.prototype.$hostname = Vue.config.productionTip ? 'https://hostname' : 'http://localhost:8080'
Vue.prototype.$apiUrl = 'http://localhost:8888/IMT/CDAW/cdaw/frontend/public/api/api.php' Vue.prototype.$apiUrl = 'http://localhost:8888/IMT/CDAW/frontend/public/api/api.php'
new Vue({ new Vue({
router, router,
......
import Vue from 'vue' import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
import Index from '../views/Index.vue' import Index from '../views/Index'
import Signup from '../views/Signup.vue' import Signup from '../views/Signup'
import Home from '../views/Home.vue' import Home from '../views/Home'
import Rules from '../views/Rules.vue' import Rules from '../views/Rules'
import GameCreate from '../views/GameCreate.vue' import GameCreate from '../views/GameCreate'
import GameJoin from '../views/GameJoin.vue' import GameJoin from '../views/GameJoin'
import Game from '../views/Game.vue' import Game from '../views/Game'
Vue.use(VueRouter) Vue.use(VueRouter)
...@@ -22,7 +22,7 @@ const routes = [ ...@@ -22,7 +22,7 @@ const routes = [
component: Signup component: Signup
}, },
{ {
path: '/Home', path: '/home',
name: 'Home', name: 'Home',
component: Home component: Home
}, },
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<div id="body"> <div id="body">
<Navbar/> <Navbar/>
<div id="buttons"> <div id="buttons">
<router-link to="/Rules"><b-button variant="primary">Découvrir le mahjong</b-button></router-link> <router-link to="/rules"><b-button variant="primary">Découvrir le mahjong</b-button></router-link>
<router-link to="/Index"><b-button variant="primary">Commercer à jouer</b-button></router-link> <router-link to="/gameCreate"><b-button variant="primary">Commercer à jouer</b-button></router-link>
</div> </div>
</div> </div>
</template> </template>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</form> </form>
<hr> <hr>
<div class="text-center"> <div class="text-center">
<router-link to="/Signup"> <router-link to="/signup">
<a class="small">Créer un compte</a> <a class="small">Créer un compte</a>
</router-link> </router-link>
</div> </div>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
import bcrypt from 'bcryptjs' import bcrypt from 'bcryptjs'
export default { export default {
name: 'Login', name: 'Index',
components: { components: {
Input Input
}, },
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
let areEqual = bcrypt.compareSync(form.elements.password.value, row.password) let areEqual = bcrypt.compareSync(form.elements.password.value, row.password)
if (areEqual) { if (areEqual) {
window.location.href = "/#/Home" window.location.href = "/#/home"
} }
else { else {
document.querySelector('#message').innerHTML = "Mauvais mot de passe" document.querySelector('#message').innerHTML = "Mauvais mot de passe"
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
<form class="user" @submit="onSubmit"> <form class="user" @submit="onSubmit">
<p id="message" style="color: red"></p> <p id="message" style="color: red"></p>
<Input v-for="input in inputs" :key="input.id" :information="input" /> <Input v-for="input in inputs" :key="input.id" :information="input" />
<button type="submit" class="btn btn-primary btn-user btn-block">Connexion</button> <button type="submit" class="btn btn-primary btn-user btn-block">Inscription</button>
</form> </form>
<hr> <hr>
<div class="text-center"> <div class="text-center">
<router-link to="/Index"> <router-link to="/">
<a class="small">Déjà inscrit ? Connectez-vous !</a> <a class="small">Déjà inscrit ? Connectez-vous !</a>
</router-link> </router-link>
</div> </div>
......
{
"lockfileVersion": 1
}
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