mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 15:21:06 +03:30
structure user and izitoast and add medicalcenter
This commit is contained in:
+3
-3
@@ -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
@@ -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 = {};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user