[Notify] Fehlermeldung wenn etwas nicht ausgeführt werden konnte
This commit is contained in:
parent
306ae7648d
commit
9cdc041b13
|
@ -3,6 +3,7 @@ import { boot } from 'quasar/wrappers';
|
||||||
import config from '../config';
|
import config from '../config';
|
||||||
import { Store } from 'vuex';
|
import { Store } from 'vuex';
|
||||||
import { StateInterface } from 'src/store';
|
import { StateInterface } from 'src/store';
|
||||||
|
import { Notify } from 'quasar';
|
||||||
|
|
||||||
declare module 'vue/types/vue' {
|
declare module 'vue/types/vue' {
|
||||||
interface Vue {
|
interface Vue {
|
||||||
|
@ -43,6 +44,12 @@ export default boot<Store<StateInterface>>(({ Vue, store }) => {
|
||||||
store.commit('session/setOffline', true);
|
store.commit('session/setOffline', true);
|
||||||
} else if (e.response && e.response.status == 401) {
|
} else if (e.response && e.response.status == 401) {
|
||||||
return store.dispatch('session/clearCurrent');
|
return store.dispatch('session/clearCurrent');
|
||||||
|
} else {
|
||||||
|
Notify.create({
|
||||||
|
type: 'error',
|
||||||
|
message: 'Eine Aktion konnte nicht durchgeführt werden.',
|
||||||
|
group: false
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { boot } from 'quasar/wrappers';
|
||||||
|
import { Notify } from 'quasar';
|
||||||
|
|
||||||
|
// "async" is optional;
|
||||||
|
// more info on params: https://quasar.dev/quasar-cli/boot-files
|
||||||
|
export default boot((/* { app, router, Vue ... } */) => {
|
||||||
|
Notify.registerType('error', {
|
||||||
|
color: 'negative',
|
||||||
|
icon: 'mdi-alert-circle',
|
||||||
|
progress: true,
|
||||||
|
position: 'bottom',
|
||||||
|
actions: [{ icon: 'mdi-close', color: 'white' }]
|
||||||
|
});
|
||||||
|
});
|
|
@ -70,6 +70,7 @@ const actions: ActionTree<SessionInterface, StateInterface> = {
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
Notify.create({
|
Notify.create({
|
||||||
|
group: false,
|
||||||
type: 'negative',
|
type: 'negative',
|
||||||
message: 'Benutzername oder Passwort sind falsch.',
|
message: 'Benutzername oder Passwort sind falsch.',
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
|
|
Loading…
Reference in New Issue