forked from Gitlink/forgeplus-react
Merge pull request '修改全局消息通知' (#395) from tongChong/forgeplus-react:dev_military_admin into pre_dev_military
This commit is contained in:
commit
1347c01176
|
@ -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}`
|
||||
}
|
||||
|
|
|
@ -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(()=>{
|
||||
|
|
Loading…
Reference in New Issue