不同类型用户推出登录回到不同登录页

This commit is contained in:
lix
2025-07-31 16:08:50 +08:00
parent 808e578ff1
commit fc1c3495e9
3 changed files with 15 additions and 1 deletions

View File

@ -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);
}
})