|
|
@ -33,7 +33,7 @@ let requestlogout = false; |
|
|
|
// const location111 = useLocation(); |
|
|
|
const LayoutContainer = props => { |
|
|
|
const { |
|
|
|
dispatch, msg, user, copyright, children, sections, clientWidth, clientHeight, |
|
|
|
dispatch,actions, msg, user, copyright, children, sections, clientWidth, clientHeight, |
|
|
|
location, match, routes, history, socket, apiRoot |
|
|
|
} = props |
|
|
|
const [collapsed, setCollapsed] = useState(false) |
|
|
@ -206,13 +206,15 @@ const LayoutContainer = props => { |
|
|
|
const getUserInfoByToken = () => { |
|
|
|
if (requestUser) { |
|
|
|
requestUser = false; |
|
|
|
RouteRequest.get(RouteTable.getDomain).then(res => { |
|
|
|
console.log(res); |
|
|
|
let token = Cookie.get('pepToken', { domain: res.root }); |
|
|
|
console.log(RouteTable.apiRoot); |
|
|
|
RouteRequest.get(RouteTable.apiRoot).then(res => { |
|
|
|
let token = Cookie.get('pepToken', { domain: res.domain }); |
|
|
|
console.log(token); |
|
|
|
dispatch(login({ token })).then(res => { |
|
|
|
console.log(res); |
|
|
|
if (res.type == 'LOGIN_SUCCESS') { |
|
|
|
const data = res.payload?.user || {} |
|
|
|
dispatch(push('/businessManagement/pmReport/reserveItemsReporting')); |
|
|
|
history.push('/businessManagement/pmReport/reserveItemsReporting') |
|
|
|
localStorage.setItem('poms_open_sider', JSON.stringify(["pmReport"])) |
|
|
|
localStorage.setItem('poms_selected_sider', JSON.stringify(["businessManagement"])) |
|
|
|
localStorage.setItem('word', JSON.stringify('')) //系统登录代码时候存的,不清楚意义 |
|
|
|