call get setttings path on user login
This commit is contained in:
parent
875a45451a
commit
8c35449ce4
|
@ -2,6 +2,7 @@ import _ from 'lodash';
|
||||||
|
|
||||||
import API from 'lib-app/api-call';
|
import API from 'lib-app/api-call';
|
||||||
import AdminDataActions from 'actions/admin-data-actions';
|
import AdminDataActions from 'actions/admin-data-actions';
|
||||||
|
import ConfigActions from 'actions/config-actions';
|
||||||
import sessionStore from 'lib-app/session-store';
|
import sessionStore from 'lib-app/session-store';
|
||||||
import store from 'app/store';
|
import store from 'app/store';
|
||||||
|
|
||||||
|
@ -16,7 +17,9 @@ export default {
|
||||||
path: '/user/login',
|
path: '/user/login',
|
||||||
data: _.extend(loginData, {remember: loginData.remember * 1})
|
data: _.extend(loginData, {remember: loginData.remember * 1})
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
store.dispatch(this.getUserData(result.data.userId, result.data.token, result.data.staff)).then(() => {
|
store.dispatch(this.getUserData(result.data.userId, result.data.token, result.data.staff))
|
||||||
|
.then(() => store.dispatch(ConfigActions.updateData()))
|
||||||
|
.then(() => {
|
||||||
if(result.data.staff) {
|
if(result.data.staff) {
|
||||||
store.dispatch(AdminDataActions.retrieveCustomResponses());
|
store.dispatch(AdminDataActions.retrieveCustomResponses());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
import {dispatch} from 'app/store';
|
import store from 'app/store';
|
||||||
import SessionActions from 'actions/session-actions';
|
import SessionActions from 'actions/session-actions';
|
||||||
import i18n from 'lib-app/i18n';
|
import i18n from 'lib-app/i18n';
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ class DashboardMenu extends React.Component {
|
||||||
if (itemIndex < this.getDashboardRoutes().length) {
|
if (itemIndex < this.getDashboardRoutes().length) {
|
||||||
this.goToPathByIndex(itemIndex)
|
this.goToPathByIndex(itemIndex)
|
||||||
} else {
|
} else {
|
||||||
dispatch(SessionActions.logout());
|
store.dispatch(SessionActions.logout());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue