不同类型用户推出登录回到不同登录页
This commit is contained in:
@ -47,6 +47,9 @@ const GlobalHeaderRight: React.FC<{}> = (props) => {
|
||||
// let _data = {
|
||||
// mall3_token: sessionStorage.getItem('Authorization')
|
||||
// }
|
||||
// 获取用户类型,用于判断返回哪个登录页面
|
||||
const userType = localStorage.getItem('userType');
|
||||
|
||||
Modal.info({
|
||||
title: '请确认是否退出?',
|
||||
content: false,
|
||||
@ -63,8 +66,17 @@ const GlobalHeaderRight: React.FC<{}> = (props) => {
|
||||
message.success('退出登录成功');
|
||||
sessionStorage.clear();
|
||||
cookie.remove('mall3_token');
|
||||
|
||||
// 清空用户类型
|
||||
localStorage.removeItem('userType');
|
||||
|
||||
// 根据用户类型返回不同的登录页面
|
||||
setTimeout(() => {
|
||||
history.push('/login');
|
||||
if (userType === 'internal') {
|
||||
history.push('/internal-login'); // 内部用户返回内部登录页
|
||||
} else {
|
||||
history.push('/login'); // 普通用户返回普通登录页
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user