Commit 28510980 authored by 杨思琦's avatar 杨思琦

fix: 首页img路径修改

parent dfd8f5f4
Pipeline #60432 waiting for manual action with stages
import React , {useEffect} from 'react'; import React, { useEffect } from 'react';
import { Helmet } from 'react-helmet'; import { Helmet } from 'react-helmet';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
...@@ -16,20 +16,28 @@ const config = require('../../../config/config'); ...@@ -16,20 +16,28 @@ const config = require('../../../config/config');
const App = props => { const App = props => {
useEffect(() => { useEffect(() => {
event.emit('loading' , props.loading); event.emit('loading', props.loading);
}, [props.loading]) }, [props.loading]);
const metaSecurity = /https/.test(window.location.protocol) ? ( const metaSecurity = /https/.test(window.location.protocol) ? (
<meta httpEquiv='Content-Security-Policy' content='upgrade-insecure-requests' /> <meta httpEquiv="Content-Security-Policy" content="upgrade-insecure-requests" />
) : null; ) : null;
return ( return (
<> <>
<Helmet title={`${(props.global && props.global.title) || defaultSetting.title}`}> <Helmet title={`${(props.global && props.global.title) || defaultSetting.title}`}>
<title>{`${(props.global && props.global.title) || defaultSetting.title}`}</title> <title>{`${(props.global && props.global.title) || defaultSetting.title}`}</title>
<link rel='shortcut icon' {/* <link rel='shortcut icon'
href={`${window.location.origin}/web4/${props.global && props.global.shortcutIcon}`} /> href={`${window.location.origin}/web4/${props.global && props.global.shortcutIcon}`} /> */}
<link
rel="shortcut icon"
href={
props.global && props.global.shortcutIcon
? `${window.location.origin}/web4/${props.global.shortcutIcon}`
: defaultSetting.logo
}
/>
{metaSecurity} {metaSecurity}
<meta name='description' content={`${(props.global && props.global.title) || defaultSetting.title}`} /> <meta name="description" content={`${(props.global && props.global.title) || defaultSetting.title}`} />
</Helmet> </Helmet>
<Router basename={config.base || pkg.name.toLocaleLowerCase() || ''}> <Router basename={config.base || pkg.name.toLocaleLowerCase() || ''}>
<Switch> <Switch>
...@@ -45,7 +53,7 @@ const App = props => { ...@@ -45,7 +53,7 @@ const App = props => {
</Router> </Router>
</> </>
); );
} };
const mapStateToProps = state => ({ const mapStateToProps = state => ({
global: state.getIn(['global', 'globalConfig']), global: state.getIn(['global', 'globalConfig']),
......
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