|
@ -20,9 +20,16 @@ const Login = props => { |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
if (user && user.authorized) { |
|
|
if (user && user.authorized) { |
|
|
|
|
|
|
|
|
|
|
|
const receiver = document.getElementById('iotAuth').contentWindow; |
|
|
|
|
|
// receiver.postMessage(user, "http://localhost:4200/cross"); |
|
|
|
|
|
receiver.postMessage('user', "*"); |
|
|
|
|
|
|
|
|
dispatch(push('/equipmentWarehouse/nvr')); |
|
|
dispatch(push('/equipmentWarehouse/nvr')); |
|
|
localStorage.setItem('vcmp_selected_sider', JSON.stringify(['nvr'])) |
|
|
localStorage.setItem('vcmp_selected_sider', JSON.stringify(['nvr'])) |
|
|
localStorage.setItem('vcmp_open_sider', JSON.stringify(['equipmentWarehouse'])) |
|
|
localStorage.setItem('vcmp_open_sider', JSON.stringify(['equipmentWarehouse'])) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, [user]) |
|
|
}, [user]) |
|
|
|
|
|
|
|
@ -79,6 +86,9 @@ const Login = props => { |
|
|
<Button htmlType='submit' block theme="solid" style={{ marginTop: 17, height: 40, backgroundColor: '#1859C1' }}>立即登录</Button> |
|
|
<Button htmlType='submit' block theme="solid" style={{ marginTop: 17, height: 40, backgroundColor: '#1859C1' }}>立即登录</Button> |
|
|
</Form> |
|
|
</Form> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<iframe loading="lazy" id="iotAuth" src="http://localhost:5200/cross" frameBorder={0}> |
|
|
|
|
|
<p>你的浏览器不支持 iframe。</p> |
|
|
|
|
|
</iframe> |
|
|
</div> |
|
|
</div> |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|