Browse Source

redirect client login

pull/2/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
8910bd730d
  1. 4
      src/containers/DefaultLayout/DefaultLayout.js
  2. 3
      src/views/Pages/Login/Login.js

4
src/containers/DefaultLayout/DefaultLayout.js

@ -269,9 +269,7 @@ class DefaultLayout extends Component {
)} /> )} />
) : (null); ) : (null);
})} })}
{ this.state.role_id == 28 ? ( <Redirect from="/" to="/dashboard" />
<Redirect from="/" to="/dashboard-customer/48/50" />
) : <Redirect from="/" to="/dashboard" /> }
</Switch> </Switch>
</Suspense> </Suspense>
</Container> </Container>

3
src/views/Pages/Login/Login.js

@ -108,6 +108,9 @@ class Login extends Component {
let resData = result.data.data let resData = result.data.data
window.localStorage.setItem('menu_login', JSON.stringify(resData)); window.localStorage.setItem('menu_login', JSON.stringify(resData));
this.setState({ loader: false }) this.setState({ loader: false })
if(role_id == 48){
this.props.history.push("/dashboard-customer/48/50");
}
this.props.history.push("/dashboard"); this.props.history.push("/dashboard");
} else { } else {
NotificationManager.error('Login Failed', 'Failed'); NotificationManager.error('Login Failed', 'Failed');

Loading…
Cancel
Save