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);
|
||||
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);
|
||||
|
||||
|
|
|
@ -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}`;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="container-fluid px-xl-5 mt-3">
|
||||
<div class="row">
|
||||
<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>
|
||||
<!--p>{{ events }}</p-->
|
||||
<ul>
|
||||
|
|
Loading…
Reference in a new issue