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

fix: 首页光有产品类型时的异常问题

parent 9621d3aa
...@@ -376,7 +376,7 @@ class Site { ...@@ -376,7 +376,7 @@ class Site {
self.props && self.props &&
self.props.updateComplexConfig && self.props.updateComplexConfig &&
self.props.updateComplexConfig({}); self.props.updateComplexConfig({});
self.props.history && self.props.history.push(self.globalConfig.homepage ?? `/?client=${self.globalConfig.client}`); self.props.history && self.props.history.push(self.globalConfig.homepage ? `/${self.globalConfig.homepage}` : `/?client=${self.globalConfig.client}`);
// window.location.reload(); // window.location.reload();
window.share.event.emit('triggerMicro', this.props.global); window.share.event.emit('triggerMicro', this.props.global);
}); });
......
...@@ -223,11 +223,18 @@ class Login { ...@@ -223,11 +223,18 @@ class Login {
if (result && result.length > 0) { if (result && result.length > 0) {
const config = result.shift(); const config = result.shift();
const homeType = config.productType || 'civweb4'; const homeType = config.productType || 'civweb4';
// 产品类型和首页路径同时有才行
const homepage =
homeType && (params.getParams('redirect') || config.homepage)
? homeType +
'/' +
(params.getParams('redirect') || config.homepage)
: '';
self.globalConfig = Object.assign(self.globalConfig, config, { self.globalConfig = Object.assign(self.globalConfig, config, {
theme: self.globalConfig.theme, theme: self.globalConfig.theme,
menu: self.globalConfig.menu, menu: self.globalConfig.menu,
style: self.globalConfig.style, style: self.globalConfig.style,
homepage: homeType + '/' + (params.getParams('redirect') || config.homepage), homepage: homepage,
}); });
if(self.globalConfig.hasOwnProperty('webConfig')) { if(self.globalConfig.hasOwnProperty('webConfig')) {
......
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