added spinner and check input
This commit is contained in:
25
src/main.js
25
src/main.js
@@ -20,6 +20,10 @@ import '@/assets/styles.scss';
|
||||
import '@/assets/tailwind.css';
|
||||
import { config } from 'md-editor-v3';
|
||||
|
||||
import { LoadingStore } from './stores/LoadingStore.js';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
config({
|
||||
@@ -53,6 +57,9 @@ var auth = createAuth({
|
||||
});
|
||||
|
||||
axios.defaults.baseURL = import.meta.env.VITE_BACKEND_URL;//'http://localhost:8081'///
|
||||
|
||||
|
||||
|
||||
console.log(import.meta.env.VITE_BACKEND_URL);
|
||||
|
||||
const app = createApp(App);
|
||||
@@ -78,3 +85,21 @@ app.use(auth);
|
||||
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