forgeplus-react/src/forge/Component/NoticeModal/SystemNotice.jsx

76 lines
3.2 KiB
React
Raw Normal View History

2021-10-13 17:58:45 +08:00
import React , { useEffect , useState } from 'react';
import { Modal , Button } from 'antd';
import './Index.scss';
import '../../css/index.scss';
import RenderHtml from '../../../components/render-html';
import cookie from 'react-cookies';
2021-10-13 17:58:45 +08:00
function SystemNotice({system_notification,history}){
2021-10-13 17:58:45 +08:00
const [ visible , setVisible ] = useState(false);
useEffect(()=>{
if(system_notification && !cookie.load('notice_stage')){
2021-10-13 17:58:45 +08:00
setVisible(true);
}
2021-10-20 11:05:38 +08:00
},[system_notification,history.location])
2021-10-13 17:58:45 +08:00
function sureContinue() {
2021-10-15 10:29:03 +08:00
cookie.remove('notice_stage');
2021-10-20 11:05:38 +08:00
2021-10-20 11:06:49 +08:00
let inFifteenMinutes = new Date(new Date().getTime() + 24 * 3600 * 1000);//一天
// let inFifteenMinutes = new Date(new Date().getTime() + 60 * 1000);//一分钟
2021-10-20 11:05:38 +08:00
cookie.save('notice_stage', true,{ expires: inFifteenMinutes,path:"/" });
2021-10-13 17:58:45 +08:00
setVisible(false);
}
return (
<Modal
visible = {visible}
width="1000px"
footer={false}
title={false}
centered={true}
closable={false}
wrapClassName={'systemBox'}
>
<div className="sysBox">
<div className="sysnoticeBox">
<p className="ntitle">{system_notification && system_notification.subject}</p>
<p className="nSubtitle">{system_notification && system_notification.sub_subject}</p>
{/* <div className="nContent">
<div className="nMaindesc">
为了给用户提供更加稳定优质的服务我们即将对平台门户首页平台名称平台域名进行一次全面升级与变更原平台名称Trustie中文名确实将于2021年10月xx日统一更改为Gitlink中文名确实开源届时平台域名将统一进行更换更换规则如下
</div>
<div className="realmName">
<ul>
<li>原域名</li>
<li>官网顶级域名https://www.trustie.net</li>
<li>版本库子域名https://forgeplus.trustie.net</li>
<li>论坛子域名https://forum.trustie.net/forums</li>
</ul>
<ul>
<li>更换后域名</li>
<li>官网顶级域名https://www.gitlink.org.cn</li>
<li>版本库子域名https://www.git.gitlink.org.cn</li>
<li>论坛子域名https://forum.gitlink.org.cn</li>
</ul>
</div>
<div className="nSubdesc">
自2021年10月xx日起旧域名将停止访问因平台名称与域名变更给您带来的不便我们深表歉意!非常感谢您一直以来对本平台的信任与支持我们将一如既往地为您提供优质的服务 特此通知!
</div>
<div className="nInfo">
<p>Gitlink运营团队</p>
<p>2021年10月xx日</p>
</div>
</div> */}
<RenderHtml className="break_word_comments imageLayerParent" value={system_notification && system_notification.content} url={history.location}/>
<div className="nBtn">
<Button type="primary" className="btnblue" onClick={sureContinue}>确认并继续</Button>
</div>
</div>
</div>
</Modal>
)
}
export default SystemNotice;