Commit 980851a3 authored by 邓晓峰's avatar 邓晓峰

fix: 修复logo配置

parent d1f4cd0b
Pipeline #43804 passed with stages
in 4 minutes 21 seconds
...@@ -15,6 +15,7 @@ module.exports = { ...@@ -15,6 +15,7 @@ module.exports = {
...defaultSetting ...defaultSetting
}, },
fastRefresh: true, fastRefresh: true,
useHash: true,
locale: { locale: {
default: 'zh-CN', default: 'zh-CN',
antd: true, antd: true,
......
...@@ -17,17 +17,17 @@ export default { ...@@ -17,17 +17,17 @@ export default {
// }, // },
{ {
name: 'civ_pandawork', name: 'civ_pandawork',
entry: `//${window.location.hostname}:8080/civ_pandawork`, entry: `//${window.location.hostname}:8081/civ_pandawork`,
container: '#micro-container', container: '#micro-container',
activeRule: '/civbase/civ_pandawork', activeRule: '/civbase/civ_pandawork',
}, },
{ {
name: 'report', name: 'report',
entry: `//${window.location.hostname}:8345/report/workplatform`, entry: `//172.16.10.54:8345/report/workplatform`,
container: '#micro-container', container: '#micro-container',
activeRule: '/civbase/report', activeRule: '/civbase/report',
props: { props: {
origin: `//${window.location.hostname}:8345` origin: `//172.16.10.54:8345`
} }
}, },
// { // {
......
/* eslint-disable */ /* eslint-disable */
// const proxyURL = process.env.NODE_ENV !== 'production' ? 'http://192.168.10.150:8777' : window.location.origin; // const proxyURL = process.env.NODE_ENV !== 'production' ? 'http://192.168.10.150:8777' : window.location.origin;
const proxyURL = 'https://panda-water.com'; const proxyURL = 'https://work.panda-water.cn';
module.exports = { module.exports = {
assetsRoot: process.env.NODE_ENV !== 'production' ? proxyURL : './', assetsRoot: process.env.NODE_ENV !== 'production' ? proxyURL : './',
......
This diff is collapsed.
...@@ -27,7 +27,7 @@ module.exports = require('./webpack.base.babel')({ ...@@ -27,7 +27,7 @@ module.exports = require('./webpack.base.babel')({
compress: { compress: {
comparisons: false, comparisons: false,
}, },
drop_debugger: true, drop_debugger: true,
drop_console: true, drop_console: true,
pure_funcs: ['console.log'], pure_funcs: ['console.log'],
parse: {}, parse: {},
...@@ -43,8 +43,8 @@ module.exports = require('./webpack.base.babel')({ ...@@ -43,8 +43,8 @@ module.exports = require('./webpack.base.babel')({
}), }),
], ],
nodeEnv: 'production', nodeEnv: 'production',
// chunkIds: "deterministic", chunkIds: 'deterministic',
// moduleIds: "deterministic", moduleIds: 'deterministic',
usedExports: true, usedExports: true,
sideEffects: true, sideEffects: true,
concatenateModules: true, concatenateModules: true,
......
...@@ -3,14 +3,9 @@ import React, { Suspense } from 'react'; ...@@ -3,14 +3,9 @@ import React, { Suspense } from 'react';
import { Helmet } from 'react-helmet'; import { Helmet } from 'react-helmet';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
// import { renderRoutes } from 'react-router-config'; // import { renderRoutes } from 'react-router-config';
import { renderRoutes } from '../../utils/routes' import { Router, Switch, Route, Redirect } from '@wisdom-utils/runtime';
import { renderRoutes } from '../../utils/routes';
// import BootPage from '../../pages/bootpage'; // import BootPage from '../../pages/bootpage';
import {
Router,
Switch,
Route,
Redirect
} from '@wisdom-utils/runtime';
import { dyRoutes } from '../../routes/config'; import { dyRoutes } from '../../routes/config';
// import routeContext from '@ant-design/pro-layout/lib/RouteContext'; // import routeContext from '@ant-design/pro-layout/lib/RouteContext';
...@@ -20,10 +15,14 @@ const pkg = require('../../../package.json'); ...@@ -20,10 +15,14 @@ const pkg = require('../../../package.json');
const config = require('../../../config/config'); const config = require('../../../config/config');
const defaultSetting = config.layout; const defaultSetting = config.layout;
function App(props) { function App(props) {
// //
const metaSecurity = /https/.test(window.location.protocol) ? <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"></meta>: null; const metaSecurity = /https/.test(window.location.protocol) ? (
<meta
httpEquiv="Content-Security-Policy"
content="upgrade-insecure-requests"
/>
) : null;
return ( return (
<> <>
<Helmet <Helmet
...@@ -37,9 +36,7 @@ function App(props) { ...@@ -37,9 +36,7 @@ function App(props) {
href={`https://panda-water.cn/web4/${props.global && href={`https://panda-water.cn/web4/${props.global &&
props.global.shortcutIcon}`} props.global.shortcutIcon}`}
/> />
{ {metaSecurity}
metaSecurity
}
<meta <meta
name="description" name="description"
content={`${props.global && props.global.title}`} content={`${props.global && props.global.title}`}
......
...@@ -354,7 +354,7 @@ const BasicLayout = props => { ...@@ -354,7 +354,7 @@ const BasicLayout = props => {
// setChildrenRoutes(currentChildrenRoute) // setChildrenRoutes(currentChildrenRoute)
window.share.event.on('goHome', url => { window.share.event.on('goHome', url => {
setChildrenRoutes([ setChildrenRoutes([
{ {
icon: <HomeIcon/>, icon: <HomeIcon/>,
...@@ -362,11 +362,11 @@ const BasicLayout = props => { ...@@ -362,11 +362,11 @@ const BasicLayout = props => {
name: '首页' name: '首页'
} }
]); ]);
setTabActiveKey(url); setTabActiveKey(url);
window.history.pushState(null, '', `/civbase${url}`); window.history.pushState(null, '', `/civbase${url}`);
}); });
/** /**
* web4全屏退出,切换三级菜单高亮 * web4全屏退出,切换三级菜单高亮
...@@ -409,7 +409,7 @@ const BasicLayout = props => { ...@@ -409,7 +409,7 @@ const BasicLayout = props => {
}, []); }, []);
const handlerSecond = (item, index) => { const handlerSecond = (item, index) => {
let current = void 0; let current = void 0;
if(item && item.routes) { if(item && item.routes) {
setChildrenRoutes(item.routes); setChildrenRoutes(item.routes);
...@@ -433,7 +433,7 @@ const BasicLayout = props => { ...@@ -433,7 +433,7 @@ const BasicLayout = props => {
} else { } else {
window.history.pushState(null, '', `/civbase${current.path}`); window.history.pushState(null, '', `/civbase${current.path}`);
} }
} }
...@@ -444,7 +444,7 @@ const BasicLayout = props => { ...@@ -444,7 +444,7 @@ const BasicLayout = props => {
} }
const handleUpdateCurrentIndex = index => { const handleUpdateCurrentIndex = index => {
setSelectIndex(-1) setSelectIndex(-1)
props.updateCurrentIndex(index); props.updateCurrentIndex(index);
window.share && window.share.event.emit('trigger:updateMenuIndex', index); window.share && window.share.event.emit('trigger:updateMenuIndex', index);
...@@ -452,7 +452,7 @@ const BasicLayout = props => { ...@@ -452,7 +452,7 @@ const BasicLayout = props => {
} }
const handleSelectMenuItem = (item) => { const handleSelectMenuItem = (item) => {
setTabActiveKey(item); setTabActiveKey(item);
if(item.indexOf('web_console') === -1) { if(item.indexOf('web_console') === -1) {
window.history.pushState(null, '', `/civbase${item}`); window.history.pushState(null, '', `/civbase${item}`);
...@@ -517,7 +517,7 @@ const BasicLayout = props => { ...@@ -517,7 +517,7 @@ const BasicLayout = props => {
setCollapse(!collapse); setCollapse(!collapse);
} }
// const logo = props.global && props.global.get('bannerLogo')? window.globalConfig.transformDevAssetsBaseURL(props.global.get('bannerLogo')): defaultSetting.logo; const logo = props.global && props.global.get('bannerLogo')? window.globalConfig.transformDevAssetsBaseURL(props.global.get('bannerLogo')): defaultSetting.logo;
console.log("children", props.children, props); console.log("children", props.children, props);
return ( return (
<SecurityLayout loading> <SecurityLayout loading>
...@@ -617,7 +617,7 @@ const BasicLayout = props => { ...@@ -617,7 +617,7 @@ const BasicLayout = props => {
<img src={require('../assets/basic/图层 998@2x.png')} style={{width: '100%'}}/> <img src={require('../assets/basic/图层 998@2x.png')} style={{width: '100%'}}/>
<div className={layoutStyles.header}> <div className={layoutStyles.header}>
<a className={layoutStyles.logo} onClick={handlerIndustry}> <a className={layoutStyles.logo} onClick={handlerIndustry}>
<img src="https://panda-water.com/web4/assets/images/logo/单独图案-白色.svg" alt="logo"/> <img src={`${logo}`} alt="logo"/>
</a> </a>
<div className={layoutStyles.title}>{props.global.title}</div> <div className={layoutStyles.title}>{props.global.title}</div>
{ {
...@@ -693,7 +693,7 @@ const BasicLayout = props => { ...@@ -693,7 +693,7 @@ const BasicLayout = props => {
</PageContainer> </PageContainer>
) )
} }
</SecurityLayout>); </SecurityLayout>);
}; };
......
...@@ -2,30 +2,27 @@ import React from 'react'; ...@@ -2,30 +2,27 @@ import React from 'react';
import Iframe from 'react-iframe'; import Iframe from 'react-iframe';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
const ShareFrame = props => { const ShareFrame = props => {
const state = props.location.state || {}; const state = props.location.state || {};
if(!state.linkUrl) { if (!state.linkUrl) {
return null; return null;
} }
const { token, userInfo } = props.global; const { token, userInfo } = props.global;
return (
<Iframe url={`${state.linkUrl}?token=${token}&loginName=${userInfo.loginName}`}
width="100%"
height="100%"
id="myId"
frameBorder="0"
className="myClassname"
display="initial"
position="relative"/>
)
}
return (
<Iframe
url={`http://172.16.10.54:8345/report/manageView/638220756398120960?token=${token}&loginName=${userInfo.loginName}`}
width="100%"
height="100%"
id="myId"
frameBorder="0"
className="myClassname"
display="initial"
position="relative"
/>
);
};
const mapStateToProps = state => ({ const mapStateToProps = state => ({
global: state.getIn(['global', 'globalConfig']) global: state.getIn(['global', 'globalConfig']),
}); });
export default connect( export default connect(mapStateToProps)(ShareFrame);
mapStateToProps
)(ShareFrame);
\ No newline at end of file
...@@ -52,7 +52,7 @@ const getURL = url => { ...@@ -52,7 +52,7 @@ const getURL = url => {
}; };
const generRotes = (widgets, parent, level = 0) => { const generRotes = (widgets, parent, level = 0) => {
const ret = []; const ret = [];
if(!widgets || widgets.length === 0){ if(!widgets || widgets.length === 0){
return return
...@@ -131,7 +131,7 @@ const generRotes = (widgets, parent, level = 0) => { ...@@ -131,7 +131,7 @@ const generRotes = (widgets, parent, level = 0) => {
}; };
if(/iframe/.test(url)) { if(/iframe/.test(url)) {
url = url.replace(/\/report/, ''); url = url.replace(/\/report/, '');
common = { common = {
name: item.label, name: item.label,
level: l, level: l,
...@@ -151,7 +151,7 @@ const generRotes = (widgets, parent, level = 0) => { ...@@ -151,7 +151,7 @@ const generRotes = (widgets, parent, level = 0) => {
params: getParams(url), params: getParams(url),
parent, parent,
} }
} }
ret.push(common); ret.push(common);
} }
}); });
...@@ -167,16 +167,20 @@ export const transformWidgets = (widgets) => { ...@@ -167,16 +167,20 @@ export const transformWidgets = (widgets) => {
const homePageConvertArray = homepage.split("/"); const homePageConvertArray = homepage.split("/");
const findIndex = widgets && widgets.findIndex(item => item.label === '系统菜单组'); const findIndex = widgets && widgets.findIndex(item => item.label === '系统菜单组');
if(findIndex === -1 && homePageConvertArray[0] !== 'civweb4') { if(findIndex === -1 && homePageConvertArray[0] !== 'civweb4') {
widgets.push({ const index = widgets.findIndex(item => item.label === '首页');
label: "系统菜单组", if(index === -1) {
icon: '', widgets.push({
product: homePageConvertArray[0], label: "首页",
shortName: "首页", icon: '',
url: homePageConvertArray.slice(1, homePageConvertArray.length).join("/") product: homePageConvertArray[0],
}); shortName: "首页",
item.widgets = widgets; hideInMenu: true,
url: homePageConvertArray.slice(1, homePageConvertArray.length).join("/")
});
item.widgets = Array.from(new Set(widgets));
}
} }
return item; return item;
}); });
} }
......
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