Merge branch 'dev_military_qz2022' of http://106.75.45.236:3000/tongChong/forgeplus-react into dev_military_qz2022

This commit is contained in:
何童崇 2022-04-21 10:44:10 +08:00
commit 070af23ff2
6 changed files with 17 additions and 11 deletions

View File

@ -70,6 +70,10 @@ export default ({ current_user, showLoginDialog }) => {
})
}
const main_web_site_url =
localStorage.chromesetting &&
JSON.parse(localStorage.chromesetting).main_web_site_url;
return (
<div className="qz-login">
{current_user === undefined || current_user.login === "" ?
@ -83,15 +87,15 @@ export default ({ current_user, showLoginDialog }) => {
</span>
:
<div className="ml30 edu-menu-panel" style={{ height: "70px", lineHeight: "70px" }}>
<a href={`/users/${current_user === undefined ? "" : current_user.login}/courses`}>
{/* <a href={`/users/${current_user === undefined ? "" : current_user.login}/courses`}> */}
<img alt="头像" className="radius" height="34" id="nh_user_logo" name="avatar_image"
src={getImageUrl(current_user.image_url)} width="34">
</img>
</a>
{/* </a> */}
<ul className="edu-menu-list" style={{ top: '60px', textAlign: 'center' }}>
<li className="bor-bottom-greyE" style={{ cursor: "default", background: "#fff" }}>{current_user.username}</li>
<li>
<Link to={`/users/${current_user.login}`}>个人中心</Link>
<a target='_blank' href={`${main_web_site_url}/accounts/${current_user.login}`}>个人中心</a>
</li>
<li>
<Link to={`/task/myTask`}>创客管理</Link>

View File

@ -219,13 +219,13 @@ const Qz2022 = (props) => {
{/* 通知公告编辑页 */}
<Route path="/competition/qz2022/notice/:type/:noticeId"
render={
({ match }) => (<NoticeEdit {...props} match={match} />)
({ match }) => (<NoticeEdit {...props} match={match} qzDetail={qzDetail}/>)
}
></Route>
{/* 通知公告新增页 */}
<Route path="/competition/qz2022/notice/:type"
render={
({ match }) => (<NoticeEdit {...props} match={match} />)
({ match }) => (<NoticeEdit {...props} match={match} qzDetail={qzDetail}/>)
}
></Route>
{/* 大赛介绍、大赛指南、关于我们 编辑页 */}

View File

@ -13,12 +13,13 @@ export default Form.create()((props) => {
const {getFieldDecorator, validateFields, setFieldsValue } = form;
const [description, setDescription] = useState(qzDetail && type === "introduce" ? (qzDetail && qzDetail.content) : type === "fingerpost" ? (qzDetail && qzDetail.guide) : (qzDetail && qzDetail.about_us));
const [errorMessage, setErrorMessage] = useState(undefined);
const manageEdit = (qzDetail && qzDetail.is_manager) || (current_user && current_user.admin);
useEffect(() =>{
if(current_user && !current_user.admin){
if(!manageEdit){
window.location.href="/403";
}
}, [])
}, [manageEdit])
useEffect(()=>{
setDescription(qzDetail && type === "introduce" ? (qzDetail && qzDetail.content) : type === "fingerpost" ? (qzDetail && qzDetail.guide) : (qzDetail && qzDetail.about_us));

View File

@ -5,7 +5,7 @@
}
.contact {
margin: 0 auto;
padding: 3rem;
padding:1rem 3rem;
background: #fff;
display: flex;
justify-content: space-around;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 125 KiB

View File

@ -11,16 +11,17 @@ import RenderHtml from "src/components/render-html";
const Option = Select.Option;
export default Form.create()((props) => {
const {form, history, match:{params:{noticeId,type}}, current_user} = props;
const {form, history, match:{params:{noticeId,type}}, current_user, qzDetail} = props;
const {getFieldDecorator, validateFields, setFieldsValue } = form;
const [description, setDescription] = useState(undefined);
const [errorMessage, setErrorMessage] = useState(undefined);
const manageEdit = (qzDetail && qzDetail.is_manager) || (current_user && current_user.admin);
useEffect(() =>{
if(current_user && !current_user.admin){
if(!manageEdit){
window.location.href="/403";
}
}, [])
}, [manageEdit])
useEffect(() => {
if(noticeId && type === "edit"){