| Server IP : 34.87.99.72 / Your IP : 216.73.217.31 Web Server : Apache/2.4.46 (Unix) OpenSSL/1.1.1n System : Linux zlock-bitnami-lamp-prod-v2-vm 4.19.0-16-cloud-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 User : bitnami ( 1000) PHP Version : 7.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/bitnami/htdocs/app/resources/js/ |
Upload File : |
/**
* 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.
*/
window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
window.axios.defaults.headers.common['OpenKey'] = 'web';
window.axios.interceptors.response.use( (response) => {
// Return a successful response back to the calling service
return response;
}, (error) => {
if (error.response.status == 429)
{
window.Vue.prototype['$toast'].warning('Too Many Requests, Please Try Again Later.')
}
else if (error.response.status === 401)
{
// Logout user if token refresh didn't work or user is disabled
window.localStorage.clear()
window.Vue.router.push('/login')
window.Vue.prototype['$toast'].warning('Session Expired. Please Login Again.')
return new Promise((resolve, reject) => {
reject(error.response);
});
}
// Return any error which is not due to authentication back to the calling service
return new Promise((resolve, reject) => {
reject(error.response);
});
});
/**
* Echo exposes an expressive API for subscribing to channels and listening
* for events that are broadcast by Laravel. Echo and event broadcasting
* allows your team to easily build robust real-time web applications.
*/
// import Echo from 'laravel-echo';
// window.Pusher = require('pusher-js');
// window.Echo = new Echo({
// broadcaster: 'pusher',
// key: process.env.MIX_PUSHER_APP_KEY,
// //cluster: process.env.MIX_PUSHER_APP_CLUSTER,
// encrypted: false,
// // wsHost: window.location.hostname,
// wsHost: "127.0.0.1",
// wsPort: 6001,
// });