Commit 99535258 authored by 李纪文's avatar 李纪文

fix: 首页跳转问题

parent 45021e11
Pipeline #42006 passed with stages
in 1 minute 36 seconds
...@@ -94,6 +94,7 @@ const appReducer = (state = initialState, action) => { ...@@ -94,6 +94,7 @@ const appReducer = (state = initialState, action) => {
window.__INITIAL_STATE__.mdi = 'SDI'; window.__INITIAL_STATE__.mdi = 'SDI';
window.__INITIAL_STATE__.menu = 'banner-left'; window.__INITIAL_STATE__.menu = 'banner-left';
window.globalConfig = AppConfig(window.__INITIAL_STATE__); window.globalConfig = AppConfig(window.__INITIAL_STATE__);
window.globalConfig.productType = 'civweb4';
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
createStoreage.set('globalConfig', window.globalConfig); createStoreage.set('globalConfig', window.globalConfig);
// eslint-disable-next-line no-undef,no-case-declarations // eslint-disable-next-line no-undef,no-case-declarations
......
...@@ -211,13 +211,20 @@ export const defaultApp = () => { ...@@ -211,13 +211,20 @@ export const defaultApp = () => {
const config = createStoreage.get('globalConfig'); const config = createStoreage.get('globalConfig');
if (config && config.token) { if (config && config.token) {
const basePath =config.homepage !== '' && FILTER_FOLER_REG.test(config.homepage) ?'civweb4' :'civweb4'; // const basePath =config.homepage !== '' && FILTER_FOLER_REG.test(config.homepage) ?'civweb4' :'civweb4';
if(config && config.home) { // if(config && config.home) {
setDefaultMountApp(`/civbase/${config.home.path.replace(/^\//, '')}`); // setDefaultMountApp(`/civbase/${config.home.path.replace(/^\//, '')}`);
} else { // } else {
const homepage = _.isNull(config.homepage) ? '/index': '/' + config.homepage; // const homepage = _.isNull(config.homepage) ? '/index': '/' + config.homepage;
setDefaultMountApp(`/${pkg.name.toLocaleLowerCase()}/${basePath}${homepage}`); // setDefaultMountApp(`/${pkg.name.toLocaleLowerCase()}/${basePath}${homepage}`);
// createStoreage.set('init_web4', true)
// }
if(config.productType && config.productType !== 'civweb4') {
setDefaultMountApp(`/civbase/${config.productType}/${config.homepage.replace(/^\//, '')}`);
} else {
const homepage = _.isNull(config.productType) ? '/index': '/' + config.homepage;
setDefaultMountApp(`/${pkg.name.toLocaleLowerCase()}/civweb4${homepage}`);
createStoreage.set('init_web4', true) createStoreage.set('init_web4', true)
} }
......
...@@ -222,7 +222,8 @@ class Login { ...@@ -222,7 +222,8 @@ class Login {
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: params.getParams('redirect') || self.globalConfig.homepage || config.homepage homepage: params.getParams('redirect') || self.globalConfig.homepage || config.homepage,
productType: config.productType || self.globalConfig.productType || 'civweb4'
}); });
if(self.globalConfig.hasOwnProperty('webConfig')) { if(self.globalConfig.hasOwnProperty('webConfig')) {
...@@ -234,7 +235,8 @@ class Login { ...@@ -234,7 +235,8 @@ class Login {
} }
self.updateConfig && self.updateConfig(self.globalConfig); self.updateConfig && self.updateConfig(self.globalConfig);
createStoreage.set('globalConfig', self.globalConfig);
window.globalConfig.productType = self.globalConfig.productType;
self.getProjectItems().then(() => { self.getProjectItems().then(() => {
window.subSysCfg = {}; window.subSysCfg = {};
result.forEach(item => { result.forEach(item => {
...@@ -285,6 +287,8 @@ class Login { ...@@ -285,6 +287,8 @@ class Login {
if (mainConf.menu) self.globalConfig.menu = mainConf.menu; if (mainConf.menu) self.globalConfig.menu = mainConf.menu;
if (mainConf.shortcutIcon) if (mainConf.shortcutIcon)
self.globalConfig.shortcutIcon = mainConf.shortcutIcon; self.globalConfig.shortcutIcon = mainConf.shortcutIcon;
if (mainConf.productType)
self.globalConfig.productType = mainConf.productType;
} }
self.updateConfig && self.updateConfig(self.globalConfig); self.updateConfig && self.updateConfig(self.globalConfig);
// console.log("===loginSuccess===") // console.log("===loginSuccess===")
...@@ -297,6 +301,8 @@ class Login { ...@@ -297,6 +301,8 @@ class Login {
} else { } else {
// loginSuccess // loginSuccess
self.updateConfig && self.updateConfig(self.globalConfig); self.updateConfig && self.updateConfig(self.globalConfig);
createStoreage.set('globalConfig', self.globalConfig);
window.globalConfig.productType = self.globalConfig.productType;
// console.log("===loginSuccess===") // console.log("===loginSuccess===")
getIndustry getIndustry
? self.events.emit('toggleIndustry') ? self.events.emit('toggleIndustry')
......
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