Commit d7029e52 authored by 崔佳豪's avatar 崔佳豪

fix: 行业切换注册应用及加载首页

parent e66d65eb
......@@ -342,11 +342,11 @@ class Site {
self.setLoading(false);
// eslint-disable-next-line no-unused-expressions
self.props.updateCurrentIndex && self.props.updateCurrentIndex(0);
window.history.replaceState(
'',
'',
`/${self.globalConfig.homepage}`,
);
// window.history.replaceState(
// '',
// '',
// `/${self.globalConfig.homepage}`,
// );
self.getCityStationsForUser().then(res => {
window.share.event.emit('updateSite', res);
});
......@@ -357,6 +357,7 @@ class Site {
self.props &&
self.props.updateComplexConfig &&
self.props.updateComplexConfig({});
self.props.history && self.props.history.push(self.globalConfig ?? `/?client=${self.props.global.client}`);
// window.location.reload();
window.share.event.emit('triggerMicro', this.props.global);
});
......
......@@ -12,6 +12,8 @@ import { actionCreators } from '../../containers/App/store';
import SecurityLayout from '../../layouts/SecurityLayout';
import LoginAction from '../user/login/login';
import styles from './index.less';
import { useHistory } from '@wisdom-utils/runtime';
import { initMicroApps } from '@/micro';
const industries = [
{ name: '供水', type: '供水', subTitle: 'WATER SUPPLY' },
......@@ -58,6 +60,7 @@ const BootPage = props => {
const [loadding, setLoadding] = useState(false);
const [scale, setScale] = useState(1);
const history = useHistory();
useDocumentTitle(
{ title: defaultSetting.title, id: '', pageName: '行业切换' },
props.global.title || defaultSetting.title,
......@@ -77,7 +80,10 @@ const BootPage = props => {
// eslint-disable-next-line no-shadow
loginAction.events.on('toggleIndustry', event => {
setLoadding(false);
props.history.push(`/?client=${props.global.client}`);
// props.history.push(`/?client=${props.global.client}`);
initMicroApps();
// 加载首页
history.push(props.global.homepage ?? `/?client=${props.global.client}`);
window.share.event.emit('triggerMicro', props.global);
props.updateCurrentIndex(0);
// window.location.reload();
......@@ -105,6 +111,12 @@ const BootPage = props => {
[],
);
const intl = useIntl();
// const toOMSUsingAnalysis = e => {
// e && e.stopPropagation();
// props.history.push(`/omsUsingAnalysis`);
// }
return (
<SecurityLayout>
<div className={styles.bootPage}>
......@@ -145,6 +157,11 @@ const BootPage = props => {
<Spin spinning={loadding} size="large" />
</Space>
</div>
{/* <div class={styles['cloud-using-anaylysis-btn']}>
<div class="" onClick={toOMSUsingAnalysis}>
<span>平台使用分析</span>
</div>
</div> */}
</div>
</SecurityLayout>
);
......
......@@ -126,6 +126,20 @@
left: 50%;
transform: translate(-50%, -50%);
}
.cloud-using-anaylysis-btn {
position: fixed;
height: 120px;
width: 100%;
bottom: 0px;
padding: 0 20px;
display: flex;
justify-content: end;
cursor: pointer;
color: #fff;
font-size: 20px;
}
}
@media screen and (max-width: 1440px) {
......
......@@ -227,7 +227,7 @@ class Login {
theme: self.globalConfig.theme,
menu: self.globalConfig.menu,
style: self.globalConfig.style,
homepage: homeType + '/' + (params.getParams('redirect') || self.globalConfig.homepage || config.homepage),
homepage: homeType + '/' + (params.getParams('redirect') || config.homepage),
});
if(self.globalConfig.hasOwnProperty('webConfig')) {
......
......@@ -62,7 +62,7 @@ const Login = forwardRef((props, _ref) => {
action && action.events.on('loginSuccess', event => {
setSubmitting(false);
props.updateCurrentIndex && props.updateCurrentIndex(0);
props.history.push(`/`);
// props.history.push(`/`);
// debugger
// window.share.event.emit('triggerMicro', props.global);
initMicroApps();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment