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