profiling + research + download
This commit is contained in:
25
src/main.js
25
src/main.js
@@ -1,3 +1,4 @@
|
||||
import { createPinia } from 'pinia';
|
||||
import PrimeVue from 'primevue/config';
|
||||
import ConfirmationService from 'primevue/confirmationservice';
|
||||
import ToastService from 'primevue/toastservice';
|
||||
@@ -12,8 +13,8 @@ import '@/assets/styles.scss';
|
||||
import '@/assets/tailwind.css';
|
||||
import Aura from '@primevue/themes/aura';
|
||||
import axios from 'axios';
|
||||
|
||||
axios.defaults.baseURL = import.meta.env.VITE_BACKEND_URL; //'http://localhost:8082'
|
||||
import { LoadingStore } from './stores/LoadingStore.js';
|
||||
axios.defaults.baseURL = 'http://localhost:8082'//import.meta.env.VITE_BACKEND_URL; //'http://localhost:8082'
|
||||
console.log(import.meta.env.VITE_BACKEND_URL);
|
||||
|
||||
|
||||
@@ -44,9 +45,11 @@ var auth = createAuth({
|
||||
});
|
||||
|
||||
const app = createApp(App);
|
||||
const pinia = createPinia();
|
||||
|
||||
app.use(router);
|
||||
app.use(auth);
|
||||
app.use(pinia);
|
||||
|
||||
const MyPreset = definePreset(Aura, {
|
||||
semantic: {
|
||||
@@ -69,3 +72,21 @@ app.use(ConfirmationService);
|
||||
app.component('BlockViewer', BlockViewer);
|
||||
|
||||
app.mount('#app');
|
||||
|
||||
const loadingStore = LoadingStore()
|
||||
|
||||
|
||||
axios.interceptors.request.use(function (config) {
|
||||
loadingStore.another_loading = true;
|
||||
return config
|
||||
}, function (error) {
|
||||
return Promise.reject(error);
|
||||
});
|
||||
|
||||
axios.interceptors.response.use(function (response) {
|
||||
loadingStore.another_loading = false;
|
||||
|
||||
return response;
|
||||
}, function (error) {
|
||||
return Promise.reject(error);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user