mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-14 00:51:06 +03:30
structure user and izitoast and add medicalcenter
This commit is contained in:
Vendored
+7
-4
@@ -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
@@ -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 = {};
|
||||
}
|
||||
};
|
||||
|
||||
Vendored
+4
-4
@@ -1,5 +1,5 @@
|
||||
// https://vuex.vuejs.org/en/mutations.html
|
||||
|
||||
export default {
|
||||
//
|
||||
}
|
||||
setInfo: (state, info) => {
|
||||
state.user = info.user;
|
||||
}
|
||||
};
|
||||
|
||||
Vendored
+1
-3
@@ -1,5 +1,3 @@
|
||||
// https://vuex.vuejs.org/en/state.html
|
||||
|
||||
export default {
|
||||
//
|
||||
user : {},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user