Update bootstrap.ts
This commit is contained in:
parent
6330d6579f
commit
3b553beac6
|
@ -1,5 +1,6 @@
|
||||||
import axios from './helpers/axios';
|
import axios from './helpers/axios';
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
window._ = require('lodash');
|
window._ = require('lodash');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9,9 +10,11 @@ window._ = require('lodash');
|
||||||
*/
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// @ts-ignore
|
||||||
window.$ = window.jQuery = require('jquery');
|
window.$ = window.jQuery = require('jquery');
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
window.axios = axios;
|
window.axios = axios;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,7 +26,10 @@ window.axios = axios;
|
||||||
let token = document.head.querySelector('meta[name="csrf-token"]');
|
let token = document.head.querySelector('meta[name="csrf-token"]');
|
||||||
|
|
||||||
if (token) {
|
if (token) {
|
||||||
|
// @ts-ignore
|
||||||
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
|
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
window.X_CSRF_TOKEN = token.content;
|
window.X_CSRF_TOKEN = token.content;
|
||||||
} else {
|
} else {
|
||||||
console.error('CSRF token not found in document.');
|
console.error('CSRF token not found in document.');
|
Loading…
Reference in New Issue