Commit 642f7e24 authored by 徐乐's avatar 徐乐

feat: 修改

parent d162e8ab
Pipeline #79664 waiting for manual action with stages
...@@ -274,6 +274,7 @@ const Layout = props => { ...@@ -274,6 +274,7 @@ const Layout = props => {
const { routeConfig = {}, matchPath } = pickRoutes(props.flatMenu, location.pathname); const { routeConfig = {}, matchPath } = pickRoutes(props.flatMenu, location.pathname);
const context = useContext(ConfigProvider.ConfigContext); const context = useContext(ConfigProvider.ConfigContext);
const prefixCls = props.prefixCls ?? context.getPrefixCls(); const prefixCls = props.prefixCls ?? context.getPrefixCls();
const [first, setFirst] = useState(true);
// useEffect(() => { // useEffect(() => {
// setRouteConfig(routeConfig); // setRouteConfig(routeConfig);
...@@ -359,20 +360,24 @@ const Layout = props => { ...@@ -359,20 +360,24 @@ const Layout = props => {
}, [cityData, cityLoading, props.global, props.global.userInfo, siteAction]); }, [cityData, cityLoading, props.global, props.global.userInfo, siteAction]);
const GetIntegrationConfig = () => { const GetIntegrationConfig = () => {
appService if (first) {
.GetIntegrationConfig({ appService
type: '集成登录', .GetIntegrationConfig({
userId: window.globalConfig.userInfo?.OID ?? null, type: '集成登录',
isEnable: true, userId: window.globalConfig.userInfo?.OID ?? null,
}) isEnable: true,
.then(res => { })
const { code, data } = res; .then(res => {
if (code == '0') { setFirst(false);
setIntegrationData(data); const { code, data } = res;
} else { if (code == '0') {
setIntegrationData([]); setIntegrationData(data);
} } else {
}) setIntegrationData([]);
}
})
}
} }
useEffect(() => { useEffect(() => {
...@@ -386,7 +391,7 @@ const Layout = props => { ...@@ -386,7 +391,7 @@ const Layout = props => {
const handleToggleIndustry = event => { const handleToggleIndustry = event => {
setVisible(false); setVisible(false);
setIntegrationLoading(false); setIntegrationLoading(false);
props.history.push(`/?client=${window.globalConfig.homepage.client}`); props.history.push(`/?client=${window.globalConfig.client}`);
props.updateCurrentIndex(0); props.updateCurrentIndex(0);
defaultApp(); defaultApp();
}; };
......
...@@ -221,7 +221,7 @@ class Login { ...@@ -221,7 +221,7 @@ class Login {
? this.globalConfig.userInfo.fullName ? this.globalConfig.userInfo.fullName
: '', : '',
}) })
.catch(error => {}); .catch(error => { });
} }
if (window.location.host === 'panda-water.com') { if (window.location.host === 'panda-water.com') {
...@@ -235,7 +235,7 @@ class Login { ...@@ -235,7 +235,7 @@ class Login {
? this.globalConfig.userInfo.fullName ? this.globalConfig.userInfo.fullName
: '', : '',
}) })
.catch(error => {}); .catch(error => { });
} }
} }
...@@ -372,9 +372,8 @@ class Login { ...@@ -372,9 +372,8 @@ class Login {
mqttConfig.mqtt_mess.TcpPort = DEFAULT_TCP_PORT; mqttConfig.mqtt_mess.TcpPort = DEFAULT_TCP_PORT;
mqttConfig.mqtt_IsSSL = `${mqttConfig.mqtt_mess.TcpIP}:${mqttConfig.mqtt_mess.TcpPort}`; mqttConfig.mqtt_IsSSL = `${mqttConfig.mqtt_mess.TcpIP}:${mqttConfig.mqtt_mess.TcpPort}`;
} }
mqttConfig.mqtt_iotIP = `${mqttConfig.mqtt_mess.TcpIP}:${ mqttConfig.mqtt_iotIP = `${mqttConfig.mqtt_mess.TcpIP}:${mqttConfig.mqtt_mess.TcpPort ? mqttConfig.mqtt_mess.TcpPort : '443'
mqttConfig.mqtt_mess.TcpPort ? mqttConfig.mqtt_mess.TcpPort : '443' }`;
}`;
self.globalConfig = Object.assign(self.globalConfig, { self.globalConfig = Object.assign(self.globalConfig, {
...mqttConfig, ...mqttConfig,
}); });
...@@ -418,6 +417,12 @@ class Login { ...@@ -418,6 +417,12 @@ class Login {
}); });
if (this.globalConfig?.isIntegration >= 1) { if (this.globalConfig?.isIntegration >= 1) {
self.globalConfig = Object.assign(self.globalConfig, config, {
widgets: config.widgets || [],
allWidgets: config.widgets || [],
uiwidgets: config.uiwidgets || [],
});
self.updateConfig && self.updateConfig(self.globalConfig); self.updateConfig && self.updateConfig(self.globalConfig);
} }
...@@ -736,7 +741,7 @@ class Login { ...@@ -736,7 +741,7 @@ class Login {
height: '400', height: '400',
}); });
const handleMessage = function(event) { const handleMessage = function (event) {
const { origin } = event; const { origin } = event;
// Logger.log('origin', event.origin); // Logger.log('origin', event.origin);
if (origin === 'https://login.dingtalk.com') { if (origin === 'https://login.dingtalk.com') {
......
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