Commit 3edb22c5 authored by 崔佳豪's avatar 崔佳豪

fix: 当前功能和下一个站点首页相同的问题

parent 414052e4
Pipeline #48641 passed with stages
in 2 minutes 25 seconds
...@@ -360,11 +360,7 @@ class Site { ...@@ -360,11 +360,7 @@ class Site {
// 重新加载订阅消息铃铛 // 重新加载订阅消息铃铛
window.share && window.share.event && window.share.event.emit('reloadNotice'); window.share && window.share.event && window.share.event.emit('reloadNotice');
const config = self.globalConfig; const config = self.globalConfig;
let url = !config.home ? ((config.homepage === '' || _.isNull(config.homepage)) ? `/civweb4`: `/civweb4/${config.homepage.replace(/^\//, '').replace(/^civweb4\//, '')}`) : `/${config.homepage.replace(/^\//, '')}`; let url = !config.home ? ((config.homepage === '' || _.isNull(config.homepage)) ? `/civweb4`: `/${config.homepage.replace(/^\//, '')}`) : `/${config.homepage.replace(/^\//, '')}`;
// 在云平台上,切换前后如果url一致会出问题
if(config.userInfo && config.userInfo.site) {
url += `${url.indexOf('|') > -1 ? '&' : '|' }__site__=${config.userInfo.site}`;
}
self.props.history && self.props.history.push(url); self.props.history && self.props.history.push(url);
self.props && self.props.updateCollapsed && self.props.updateCollapsed(false); self.props && self.props.updateCollapsed && self.props.updateCollapsed(false);
window.share.event.emit('triggerMicro', this.props.global); window.share.event.emit('triggerMicro', this.props.global);
......
...@@ -302,12 +302,17 @@ class Login { ...@@ -302,12 +302,17 @@ class Login {
const config = result.shift(); const config = result.shift();
const homeType = config.productType || 'civweb4'; const homeType = config.productType || 'civweb4';
// 产品类型和首页路径同时有才行 // 产品类型和首页路径同时有才行
const homepage = params.getParams('redirect') let homepage = params.getParams('redirect')
? params.getParams('redirect') ? params.getParams('redirect')
: homeType && config.homepage : homeType && config.homepage
? `${homeType}/${params.getParams('redirect') || config.homepage}` ? `${homeType}/${params.getParams('redirect') || config.homepage}`
: ''; : '';
// 在云平台上,切换前后如果url一致会出问题
if(self.globalConfig.userInfo && self.globalConfig.userInfo.site) {
homepage += `${homepage.indexOf('|') > -1 ? '&' : '|' }_timestate=${Date.now().toString(16)}_${self.globalConfig.userInfo.site}`;
}
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,
......
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