diff --git a/src/boot/axios.ts b/src/boot/axios.ts index da8b148..99b80ee 100644 --- a/src/boot/axios.ts +++ b/src/boot/axios.ts @@ -3,6 +3,7 @@ import { boot } from 'quasar/wrappers'; import config from '../config'; import { Store } from 'vuex'; import { StateInterface } from 'src/store'; +import { Notify } from 'quasar'; declare module 'vue/types/vue' { interface Vue { @@ -43,6 +44,12 @@ export default boot>(({ Vue, store }) => { store.commit('session/setOffline', true); } else if (e.response && e.response.status == 401) { return store.dispatch('session/clearCurrent'); + } else { + Notify.create({ + type: 'error', + message: 'Eine Aktion konnte nicht durchgeführt werden.', + group: false + }); } } return Promise.reject(error); diff --git a/src/boot/notify.ts b/src/boot/notify.ts new file mode 100644 index 0000000..513290d --- /dev/null +++ b/src/boot/notify.ts @@ -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' }] + }); +}); diff --git a/src/plugins/user/store/session.ts b/src/plugins/user/store/session.ts index d605f65..e946614 100644 --- a/src/plugins/user/store/session.ts +++ b/src/plugins/user/store/session.ts @@ -70,6 +70,7 @@ const actions: ActionTree = { }) .catch(() => { Notify.create({ + group: false, type: 'negative', message: 'Benutzername oder Passwort sind falsch.', timeout: 10000,