Commit 48ca5a32 authored by raphael.peim's avatar raphael.peim

Comment main.js

parent 8213f947
...@@ -6,13 +6,17 @@ import '@/assets/css/style.css' ...@@ -6,13 +6,17 @@ import '@/assets/css/style.css'
import 'bootstrap/dist/css/bootstrap.css' import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css' import 'bootstrap-vue/dist/bootstrap-vue.css'
// Use
Vue.use(BootstrapVue) Vue.use(BootstrapVue)
// Variables
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/BackEnd/api/index.php' Vue.prototype.$apiUrl = 'http://localhost:8888/IMT/CDAW/BackEnd/api/index.php'
// Mixin
Vue.mixin({ Vue.mixin({
// Vérification de la connexion selon l'existence du token
created: function () { created: function () {
if (localStorage.token === undefined && this.$route.name != 'Index' && this.$route.name != 'Signup') { if (localStorage.token === undefined && this.$route.name != 'Index' && this.$route.name != 'Signup') {
window.location.href = '/#/' window.location.href = '/#/'
...@@ -22,6 +26,7 @@ Vue.mixin({ ...@@ -22,6 +26,7 @@ Vue.mixin({
} }
}, },
methods: { methods: {
// Requête bloquée
isExpired() { isExpired() {
fetch(this.$apiUrl + '/validatetoken', { fetch(this.$apiUrl + '/validatetoken', {
method: 'GET', method: 'GET',
......
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