Merge branch 'feature/vuejs' into feature/vue-serverview
This commit is contained in:
commit
05478e3277
29 changed files with 2997 additions and 16217 deletions
1
resources/assets/scripts/helpers/.gitignore
vendored
Normal file
1
resources/assets/scripts/helpers/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
ziggy.js
|
22
resources/assets/scripts/helpers/axios.js
Normal file
22
resources/assets/scripts/helpers/axios.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
import User from './../models/user';
|
||||
|
||||
/**
|
||||
* We'll load the axios HTTP library which allows us to easily issue requests
|
||||
* to our Laravel back-end. This library automatically handles sending the
|
||||
* CSRF token as a header based on the value of the "XSRF" token cookie.
|
||||
*/
|
||||
|
||||
let axios = require('axios');
|
||||
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||
axios.defaults.headers.common['Accept'] = 'application/json';
|
||||
axios.defaults.headers.common['Authorization'] = `Bearer ${User.getToken()}`;
|
||||
|
||||
if (typeof phpdebugbar !== 'undefined') {
|
||||
axios.interceptors.response.use(function (response) {
|
||||
phpdebugbar.ajaxHandler.handle(response.request);
|
||||
|
||||
return response;
|
||||
});
|
||||
}
|
||||
|
||||
export default axios;
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue