Merge pull request '修改全局消息通知' (#395) from tongChong/forgeplus-react:dev_military_admin into pre_dev_military

This commit is contained in:
xxq250 2022-06-10 10:20:00 +08:00
commit 1347c01176
2 changed files with 12 additions and 3 deletions

View File

@ -13,7 +13,7 @@ export function getImageUrl(path) {
// const local = 'http://localhost:3000'
// const local = 'http://39.105.176.215:49999';
const local = 'http://111.8.36.180:8000';
path && !path.startsWith('/') && (path = '/'.concat(path));
path && !path.startsWith('/') && !path.startsWith('http') && (path = '/'.concat(path));
if (isDev) {
return `${local}${path}`
}

View File

@ -6,12 +6,21 @@ import RenderHtml from '../../../components/render-html';
import cookie from 'react-cookies';
// import axios from 'axios';
function SystemNotice({showNotice,system_notification,history,login,hideSystemNotice}){
function SystemNotice({showNotice,system_notification,history,login,hideSystemNotice,location}){
const [ visible , setVisible ] = useState(false);
useEffect(()=>{
if(system_notification && !cookie.load('notice_stage')){
setVisible(true);
let pathname=history.location.pathname;
let isCompetition=pathname.indexOf('/competition/')>-1;
let openNotice=true;
//
if(isCompetition&&system_notification.subject.indexOf('启智')&&!(pathname.indexOf('/competition/qz2022')>-1)){
openNotice=false;
}
openNotice&&setVisible(true);
}
},[system_notification,history.location])
// useEffect(()=>{