stash
This commit is contained in:
parent
d853d0dcb2
commit
7fcf04741e
3 changed files with 8 additions and 4 deletions
|
@ -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);
|
faWindowClose, faCamera, faStop, faPen, faCheck, faTimes, faSave, faEye, faComment, faUser, faComments, faEnvelope);
|
||||||
Vue.component('font-awesome-icon', FontAwesomeIcon);
|
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);
|
sync(store, router);
|
||||||
|
|
||||||
|
|
|
@ -127,6 +127,10 @@ const store = new Vuex.Store({
|
||||||
state.user = user;
|
state.user = user;
|
||||||
localStorage.setItem('user', user);
|
localStorage.setItem('user', user);
|
||||||
},
|
},
|
||||||
|
setToken(state, token) {
|
||||||
|
state.token = token;
|
||||||
|
localStorage.setItem('token', token);
|
||||||
|
},
|
||||||
logout(state) {
|
logout(state) {
|
||||||
state.user = null;
|
state.user = null;
|
||||||
state.token = null;
|
state.token = null;
|
||||||
|
@ -145,7 +149,7 @@ const store = new Vuex.Store({
|
||||||
body: JSON.stringify({username: username, password: password}),
|
body: JSON.stringify({username: username, password: password}),
|
||||||
credentials: 'omit'
|
credentials: 'omit'
|
||||||
}).then(r => r.json())
|
}).then(r => r.json())
|
||||||
if (data.token && data.key) {
|
if (data.token) {
|
||||||
commit('setToken', data.token);
|
commit('setToken', data.token);
|
||||||
commit('setUser', username);
|
commit('setUser', username);
|
||||||
axios.defaults.headers.common['Authorization'] = `Token ${data.token}`;
|
axios.defaults.headers.common['Authorization'] = `Token ${data.token}`;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="container-fluid px-xl-5 mt-3">
|
<div class="container-fluid px-xl-5 mt-3">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xl-8 offset-xl-2">
|
<div class="col-xl-8 offset-xl-2">
|
||||||
<qr-code :text="qr_url" color="#000" bg-color="#fff" error-level="H" class="qr-code"></qr-code>
|
<!--qr-code :text="qr_url" color="#000" bg-color="#fff" error-level="H" class="qr-code"></qr-code-->
|
||||||
<h3 class="text-center">Events</h3>
|
<h3 class="text-center">Events</h3>
|
||||||
<!--p>{{ events }}</p-->
|
<!--p>{{ events }}</p-->
|
||||||
<ul>
|
<ul>
|
||||||
|
|
Loading…
Reference in a new issue