Browse Source

路由跳转名字

master
wenlele 2 years ago
parent
commit
c20d4ac18b
  1. 12
      web/client/src/layout/components/header/index.jsx
  2. 7
      web/client/src/sections/auth/containers/login.jsx

12
web/client/src/layout/components/header/index.jsx

@ -84,20 +84,12 @@ const Header = (props) => {
) )
} }
})} })}
{/* <div style={{ display: 'flex', alignItems: 'center' }}> <div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ marginLeft: 16, width: 24, height: 24 }}> <div style={{ marginLeft: 16, width: 24, height: 24 }}>
<img src="/assets/images/background/username.png" alt="" style={{ width: '100%', height: '100%' }} /> <img src="/assets/images/background/username.png" alt="" style={{ width: '100%', height: '100%' }} />
</div> </div>
<div style={{ color: '#92CBFF', fontSize: 12, marginLeft: 10, cursor: "pointer" }} onClick={() => { <div style={{ color: '#92CBFF', fontSize: 12, marginLeft: 10, cursor: "pointer" }}>{user?.name}</div>
dispatch(actions.auth.logout(user));
if (socket) {
socket.disconnect();
}
history.push(`/signin`);
}}>
退出
</div> </div>
</div> */}
{/* <Nav.Sub {/* <Nav.Sub
itemKey={"user"} itemKey={"user"}

7
web/client/src/sections/auth/containers/login.jsx

@ -8,7 +8,7 @@ import { IconLock, IconUser } from '@douyinfe/semi-icons';
import '../style.less' import '../style.less'
const Login = props => { const Login = props => {
const { dispatch, user, error, actions, apiRoot, isRequesting } = props const { dispatch, user, error, actions, apiRoot, isRequesting,webPepUrl } = props
const form = useRef(); const form = useRef();
useEffect(() => { useEffect(() => {
@ -23,6 +23,8 @@ const Login = props => {
dispatch(push('/businessManagement/pmReport/reserveItemsReporting')); dispatch(push('/businessManagement/pmReport/reserveItemsReporting'));
localStorage.setItem('poms_open_sider', JSON.stringify(["pmReport"])) localStorage.setItem('poms_open_sider', JSON.stringify(["pmReport"]))
localStorage.setItem('poms_selected_sider', JSON.stringify(["businessManagement"])) localStorage.setItem('poms_selected_sider', JSON.stringify(["businessManagement"]))
}else{
window.location.href = `${webPepUrl}/signin`
} }
}, [user]) }, [user])
@ -110,7 +112,8 @@ function mapStateToProps(state) {
error: auth.error, error: auth.error,
actions: global.actions, actions: global.actions,
apiRoot: global.apiRoot, apiRoot: global.apiRoot,
isRequesting: auth.isRequesting isRequesting: auth.isRequesting,
webPepUrl: global.webPepUrl,
} }
} }

Loading…
Cancel
Save