- Complete GGZ Ecademy Nuxt.js user portal - Learning products browser and management - Member management interface - User authentication and roles - Multi-language support (NL/EN) - Vuex store for state management - Component-based architecture
This commit is contained in:
11
plugins/axios.js
Normal file
11
plugins/axios.js
Normal file
@@ -0,0 +1,11 @@
|
||||
export default function ({ $axios, app }) {
|
||||
$axios.onError(error => {
|
||||
const code = parseInt(error.response && error.response.status)
|
||||
|
||||
if ([401, 403].includes(code)) {
|
||||
app.$auth.logout();
|
||||
}
|
||||
|
||||
return Promise.reject(error);
|
||||
})
|
||||
};
|
||||
11
plugins/constants.js
Normal file
11
plugins/constants.js
Normal file
@@ -0,0 +1,11 @@
|
||||
export const ALL_CONSTANT = {
|
||||
store: {
|
||||
members: {
|
||||
fieldsAllowedNull: ['end_membership'],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default ({}, inject) => {
|
||||
inject('constants', ALL_CONSTANT);
|
||||
};
|
||||
7
plugins/notifier.js
Normal file
7
plugins/notifier.js
Normal file
@@ -0,0 +1,7 @@
|
||||
export default ({ app, store }, inject) => {
|
||||
inject('notifier', {
|
||||
showMessage({ content = '', color = '', icon = '', errors = [] }) {
|
||||
store.commit('snackbar/showMessage', { content, color, icon, errors })
|
||||
}
|
||||
})
|
||||
}
|
||||
5
plugins/vue2-filters.js
Normal file
5
plugins/vue2-filters.js
Normal file
@@ -0,0 +1,5 @@
|
||||
// https://github.com/freearhey/vue2-filters
|
||||
import Vue from 'vue'
|
||||
import Vue2Filters from 'vue2-filters'
|
||||
|
||||
Vue.use(Vue2Filters)
|
||||
Reference in New Issue
Block a user