Browse Source

test redirect after login

pull/2/head
ardhi 2 years ago
parent
commit
59297ffed9
  1. 2
      src/components/BottomModal/BottomModal.js
  2. 9
      src/views/Pages/Login/Login.js

2
src/components/BottomModal/BottomModal.js

@ -57,7 +57,7 @@ const BottomModal = ({title, tableHeader, tableData, closeModal, isReady}) => {
return (
<Table size='sm'>
<thead style={{margin: 0, backgroundColor: '#888888', color: '#FFFFFF', fontSize: 12}}>
<tr>
<tr key={'thead'}>
<th>#</th>
{tableHeader && tableHeader.length > 0 &&
tableHeader.map((item, idx) => (

9
src/views/Pages/Login/Login.js

@ -108,7 +108,14 @@ class Login extends Component {
let resData = result.data.data
window.localStorage.setItem('menu_login', JSON.stringify(resData));
this.setState({ loader: false })
this.props.history.push("/dashboard");
// custom redirect home after login
if (role_id == 28) {
this.props.history.push(`/dashboard-customer/37/48`);
}
else {
this.props.history.push("/dashboard");
}
} else {
NotificationManager.error('Login Failed', 'Failed');
this.setState({ loader: false })

Loading…
Cancel
Save