Update bootstrap.js

This commit is contained in:
Daniel Supernault 2018-11-08 22:01:59 -07:00
parent 242a0483b8
commit 7d152a7b54
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
2 changed files with 9 additions and 9 deletions

View File

@ -5,3 +5,12 @@ window.$ = window.jQuery = require('jquery');
require('bootstrap');
window.typeahead = require('./lib/typeahead');
window.Bloodhound = require('./lib/bloodhound');
window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
let token = document.head.querySelector('meta[name="csrf-token"]');
if (token) {
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else {
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}

View File

@ -4,17 +4,8 @@ Vue.use(BootstrapVue);
window.InfiniteScroll = require('infinite-scroll');
window.filesize = require('filesize');
window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
import swal from 'sweetalert';
let token = document.head.querySelector('meta[name="csrf-token"]');
if (token) {
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else {
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}
require('./components/localstorage');
require('./components/likebutton');
require('./components/commentform');