Commit 1c899ce9 authored by 邓晓峰's avatar 邓晓峰

fix: 修复站点选择器站点名显示异常

parent defcbfd7
Pipeline #47997 skipped with stages
......@@ -110,9 +110,9 @@
"@wisdom-map/Map": "^1.0.12-17",
"@wisdom-map/arcgismap": "^1.0.79-17",
"@wisdom-map/util": "^1.0.27-0",
"@wisdom-utils/components": "0.1.53",
"@wisdom-utils/components": "0.1.54",
"@wisdom-utils/runtime": "0.0.15",
"@wisdom-utils/utils": "0.1.93",
"@wisdom-utils/utils": "0.1.94",
"animate.css": "^4.1.1",
"antd": "^4.17.4",
"compression": "1.7.4",
......
......@@ -7,11 +7,7 @@ import 'antd/dist/antd.less';
import 'file-loader?name=.htaccess!./.htaccess'; // eslint-disable-line import/extensions
import '@wisdom-utils/utils/lib/helpers/format';
import 'sanitize.css/sanitize.css';
// import { event } from '@wisdom-utils/utils';
import { ConfigProvider } from 'antd';
import { Storeage } from '@wisdom-utils/utils/lib/helpers';
// import { history } from '@wisdom-utils/runtime';
// import { actionCreators } from './containers/App/store';
import { initGlobalConfig } from './initConfig';
import './utils/event';
......@@ -19,9 +15,7 @@ import './utils/event';
// eslint-disable-next-line no-restricted-globals
const namespace = `__PANDA_STORE__${location.hostname}`;
window.createStoreage = new Storeage(namespace);
ConfigProvider.config({
prefixCls: 'panda-console-base',
});
const initLocale = () => {
localStorage.setItem('umi_locale', 'zh-CN');
};
......@@ -29,15 +23,6 @@ const initLocale = () => {
initGlobalConfig();
initLocale();
// const unlisten = (function() {
// let prePathname = '';
// return history.listen(location => {
// if (location.pathname.indexOf('/civbase/user/login') > -1 && location.pathname !== prePathname) {
// initGlobalConfig();
// }
// prePathname = location.pathname;
// });
// })();
// event.on('event:logout', () => {
// store.dispatch(actionCreators.logout());
......
......@@ -11,7 +11,7 @@ const pkg = require('../../../package.json');
const { renderRoutes } = helpers;
const config = require('../../../config/config');
function App(props) {
//
console.log(props);
const metaSecurity = /https/.test(window.location.protocol) ? (
<meta httpEquiv="Content-Security-Policy" content="upgrade-insecure-requests" />
) : null;
......
......@@ -36,16 +36,18 @@ export const initGlobalConfig = () => {
localStorage.removeItem('loginSite');
}
/* eslint-disable */
if (window.globalConfig.token !== null && Object.keys(window.globalConfig).length > 0) {
store.dispatch(actionCreators.getConfig(window.globalConfig));
// render({ appContent: '', loading: true });
initMicroApps(loader, store);
if (config.isNewYear) {
updateTheme('#ff9600');
}
} else {
// eslint-disable-next-line react-hooks/rules-of-hooks
let client = params.getParams('client') || Cookies.get('city');
// if (window.globalConfig.token !== null && Object.keys(window.globalConfig).length > 0) {
// store.dispatch(actionCreators.getConfig(window.globalConfig));
// // render({ appContent: '', loading: true });
// initMicroApps(loader, store);
// if (config.isNewYear) {
// updateTheme('#ff9600');
// }
// } else {
// // eslint-disable-next-line react-hooks/rules-of-hooks
// }
let client = params.getParams('client') || Cookies.get('city');
client = client && client !== 'undefined' ? client : 'city';
appService
.getWateWayConfig({
......@@ -138,5 +140,4 @@ export const initGlobalConfig = () => {
store.dispatch(actionCreators.getConfigError(error));
});
});
}
};
......@@ -5,26 +5,22 @@ import NewYear from './template/newYear';
import InfoLogin from './template/infoLogin';
import Yulin from './template/yulin';
import { initGlobalConfig } from '../../../initConfig';
const LoginTemplate = {
'新春 - 智联.html': NewYear,
'Dark - IOTMultiLogin.html': BaseLogin,
'Dark.html': BaseLogin,
'DarkCloud.html': BaseLogin,
'信息化.html': InfoLogin,
'项目 - 榆林.html': Yulin,
'default': BaseLogin
};
/* eslint-disable */
export default () => {
export default (props) => {
React.useEffect(() => {
initGlobalConfig();
}, []);
const loginTemplate = window.globalConfig && window.globalConfig.loginTemplate;
switch(loginTemplate) {
case '新春 - 智联.html':
return <NewYear/>
case 'Dark - IOTMultiLogin.html':
case 'Dark.html':
return <BaseLogin/>
case '信息化.html':
return <InfoLogin />
case '项目 - 榆林.html':
return <Yulin />
default:
return <BaseLogin/>;
}
}, [props.location]);
const template = window.globalConfig && window.globalConfig.loginTemplate;
const RenderComponent = LoginTemplate[template] ? LoginTemplate[template]: LoginTemplate['default'];
return <RenderComponent {...props}/>
};
......@@ -2,20 +2,34 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { history } from '@wisdom-utils/runtime';
import { Provider } from 'react-redux';
import { ConfigProvider } from 'antd';
import { ConfigProvider, message, Modal, notification } from 'antd';
import { ConnectedRouter } from 'connected-react-router/immutable';
import { ErrorBoundary, LocaleContainer } from '@wisdom-utils/components';
import store from './stores';
import Container from './components/Container';
import App from './containers/App';
const MOUNT_NODE = document.getElementById('root');
const customPrefixCls = 'panda-console-base';
Modal.config({
rootPrefixCls: customPrefixCls
});
message.config({
rootPrefixCls: customPrefixCls
});
notification.config({
rootPrefixCls: customPrefixCls
});
ConfigProvider.config({
prefixCls: customPrefixCls,
});
export const render = () => {
// eslint-disable-next-line react-hooks/rules-of-hooks
ReactDOM.render(
<Provider store={store}>
<ConnectedRouter history={history}>
<LocaleContainer>
<ConfigProvider prefixCls="panda-console-base">
<ConfigProvider prefixCls={customPrefixCls}>
<ErrorBoundary>
<Container>
<App />
......
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