From 7fcf04741e8fe11c55d3a8edaa07d405a9848d2d Mon Sep 17 00:00:00 2001 From: jedi Date: Mon, 11 Dec 2023 23:24:47 +0100 Subject: [PATCH] stash --- web/src/main.js | 4 ++-- web/src/store/index.js | 6 +++++- web/src/views/admin/Debug.vue | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/web/src/main.js b/web/src/main.js index b76c69e..d23f011 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -44,9 +44,9 @@ library.add(faPlus, faCheckCircle, faEdit, faTrash, faCat, faSyncAlt, faSort, fa faWindowClose, faCamera, faStop, faPen, faCheck, faTimes, faSave, faEye, faComment, faUser, faComments, faEnvelope); Vue.component('font-awesome-icon', FontAwesomeIcon); -import VueQRCodeComponent from 'vue-qrcode-component' +//import VueQRCodeComponent from 'vue-qrcode-component' -Vue.component('qr-code', VueQRCodeComponent) +//Vue.component('qr-code', VueQRCodeComponent) sync(store, router); diff --git a/web/src/store/index.js b/web/src/store/index.js index 7e40b4e..0b1a34c 100644 --- a/web/src/store/index.js +++ b/web/src/store/index.js @@ -127,6 +127,10 @@ const store = new Vuex.Store({ state.user = user; localStorage.setItem('user', user); }, + setToken(state, token) { + state.token = token; + localStorage.setItem('token', token); + }, logout(state) { state.user = null; state.token = null; @@ -145,7 +149,7 @@ const store = new Vuex.Store({ body: JSON.stringify({username: username, password: password}), credentials: 'omit' }).then(r => r.json()) - if (data.token && data.key) { + if (data.token) { commit('setToken', data.token); commit('setUser', username); axios.defaults.headers.common['Authorization'] = `Token ${data.token}`; diff --git a/web/src/views/admin/Debug.vue b/web/src/views/admin/Debug.vue index 6178183..e9f34ad 100644 --- a/web/src/views/admin/Debug.vue +++ b/web/src/views/admin/Debug.vue @@ -2,7 +2,7 @@
- +

Events