structure user and izitoast and add medicalcenter

This commit is contained in:
saeid_01
2019-04-20 01:32:52 +04:30
parent a4eb09fb67
commit 5831a29686
42 changed files with 7424 additions and 4948 deletions
+7 -4
View File
@@ -1,5 +1,8 @@
// https://vuex.vuejs.org/en/actions.html
import { UserService } from '@/services/auth/user.service'
export default {
//
}
async info({ commit }) {
const info = await UserService.getInfo();
commit("setInfo", info);
return true;
}
};
+3 -3
View File
@@ -1,17 +1,17 @@
import { UserService, AuthenticationError } from '@/services/auth/user.service'
import router from '@/router'
import axios from 'axios'
export default {
async login({ commit }, {cell_number, password}) {
async login({ commit, dispatch }, {cell_number, password}) {
commit('loginRequest');
try {
const token = await UserService.login(cell_number, password);
commit('loginSuccess', token);
// Redirect the user to the page he first tried to visit or to the home view
router.push(router.history.current.query.redirect || '/');
dispatch('info', {}, {root : true});
return true
} catch (e) {
if (e instanceof AuthenticationError) {
+10 -10
View File
@@ -1,12 +1,12 @@
export default {
changeCurrentModal: (state, data) => {
state.currentModal.name = data.modal;
if (data.properties) {
state.currentModal.properties = data.properties;
}
},
closeModal: (state) => {
state.currentModal.name = '';
state.currentModal.properties = {};
}
}
state.currentModal.name = data.modal;
if (data.properties) {
state.currentModal.properties = data.properties;
}
},
closeModal: state => {
state.currentModal.name = "";
state.currentModal.properties = {};
}
};
+4 -4
View File
@@ -1,5 +1,5 @@
// https://vuex.vuejs.org/en/mutations.html
export default {
//
}
setInfo: (state, info) => {
state.user = info.user;
}
};
+1 -3
View File
@@ -1,5 +1,3 @@
// https://vuex.vuejs.org/en/state.html
export default {
//
user : {},
}