forked from Gitlink/forgeplus-react
Merge branch 'cs_news' of http://106.75.45.236:3000/Gitlink/forgeplus-react into feature_news
This commit is contained in:
commit
2c956ce961
File diff suppressed because one or more lines are too long
|
|
@ -5,6 +5,7 @@ import 'code-prettify';
|
|||
import dompurify from 'dompurify';
|
||||
import { getEmoji } from '../forge/Main/emoji';
|
||||
import axios from 'axios';
|
||||
import imgError from '../images/img-error.png'
|
||||
|
||||
import { renderToString } from 'katex'
|
||||
|
||||
|
|
@ -80,9 +81,10 @@ export default ({
|
|||
const { type, expression } = math_expressions[capture];
|
||||
return renderToString(_unescape(expression) || '', { displayMode: type === 'block', throwOnError: false, output: 'html' })
|
||||
})
|
||||
rs = rs.replace(/▁/g, "▁▁▁")
|
||||
rs = dompurify.sanitize(rs.replace(/▁/g, "▁▁▁"))
|
||||
rs = rs.replaceAll('<img ', `<img onerror="javascript:this.src='${ imgError }';"`)
|
||||
resetMathExpressions()
|
||||
return dompurify.sanitize(rs)
|
||||
return rs
|
||||
}, [str,issues]);
|
||||
|
||||
// 锚点跳转,链接地址里含#对应的id
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ function DefaultImg({name,title}){
|
|||
<img src={require(`../img/color${randomNumberInRange(1,4)}.png`).default} alt="" className="color" />
|
||||
<span className="d_name">
|
||||
<span>{name}</span>
|
||||
<span>{title}</span>
|
||||
{/* <span>{title}</span> */}
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ function Partner(props) {
|
|||
|
||||
function getUnit(array){
|
||||
const newArray = array
|
||||
setMoreTypes(array.length > 0)
|
||||
setMoreTypes(array.length > 1)
|
||||
|
||||
while(newArray[1] && newArray[1].length + newArray[0].length <= 5) {
|
||||
newArray[0] = [...newArray[0], ...newArray.splice(1, 1)[0]]
|
||||
|
|
@ -44,7 +44,12 @@ function Partner(props) {
|
|||
return(
|
||||
<div className="zone_part_item" key={ k1 }>
|
||||
{ j.typeName && moreTypes && <span className="task-hide">{j.typeName}</span>}
|
||||
<a key={ k1 } href={j.link} target="_blank"><img src={j.logo} alt=""/></a>
|
||||
{
|
||||
j.link ? <a key={ k1 } href={ j.link } target="_blank" ><img src={j.logo} alt=""/></a>
|
||||
:
|
||||
<div><img src={j.logo} alt=""/></div>
|
||||
}
|
||||
|
||||
</div>
|
||||
)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ function PublicBanner(props){
|
|||
data &&
|
||||
<div className="zone_content">
|
||||
<p className="main_t">{data.mainTitle}</p>
|
||||
<p className="sub_t">{data.subTitle}</p>
|
||||
<p className="sub_t" dangerouslySetInnerHTML={{ __html: data.subTitle }}></p>
|
||||
</div>
|
||||
}
|
||||
<div className="bannerMenus">
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ function HeaderPage(props){
|
|||
<div className="boxmain zone_infos">
|
||||
<div className="zone_infos_desc">
|
||||
{data.introductionTitle && <p className="z_name">{data.introductionTitle}</p>}
|
||||
<p className="z_desc task-hide-2" style={{WebkitLineClamp:data.introductionTitle?"4":"7"}}>{data.introductionContent}</p>
|
||||
<p className="z_desc task-hide-2" style={{WebkitLineClamp:data.introductionTitle?"4":"7"}} dangerouslySetInnerHTML={{ __html: data.introductionContent }} ></p>
|
||||
</div>
|
||||
{
|
||||
data.introductionImage &&
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ function HeaderPage(props){
|
|||
<div className="boxmain zone_infos mb30">
|
||||
<div className="zone_infos_desc">
|
||||
<p className="z_name">{data.introductionTitle}</p>
|
||||
<p className="z_desc task-hide-2">{data.introductionContent}</p>
|
||||
<p className="z_desc task-hide-2" dangerouslySetInnerHTML={{ __html: data.introductionContent }} ></p>
|
||||
</div>
|
||||
{
|
||||
data.introductionImage &&
|
||||
|
|
|
|||
|
|
@ -32,7 +32,9 @@ function NewsDetail(props){
|
|||
setContent(Base64.decode(data.content));
|
||||
setIsSpin(false)
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}).catch(error=>{
|
||||
setIsSpin(false)
|
||||
})
|
||||
}
|
||||
return(
|
||||
<div className="detail_news_all">
|
||||
|
|
@ -50,7 +52,7 @@ function NewsDetail(props){
|
|||
<p className="i_name">{detail.name}</p>
|
||||
<ul className="i_ul_value">
|
||||
{ cmsDir && <li><a href={ detail.publishUserUrl } ><img src={ detail.publishUserImage } alt="" className="headimg" /> { detail.publishUserNickname }</a></li> }
|
||||
{ cmsDir && <li>发布于{detail.publishTime}</li> }
|
||||
{ cmsDir && <li>{ detail.isFirstPublish ? '创建于' : '更新于' }{detail.publishTime}</li> }
|
||||
{ detail.visits && <li><img src={liulan} alt="" className="mr5" />{detail.visits}</li> }
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ function Index(props){
|
|||
}
|
||||
return(
|
||||
<div className="information_main">
|
||||
{ id && <PublicBanner {...props} data={data} temp={ temp } adminUrl={adminUrl}/> }
|
||||
{ id ? <PublicBanner {...props} data={data} temp={ temp } adminUrl={adminUrl}/> : <div style={{ width: '100%', height: '450px' }}></div>}
|
||||
<Switch>
|
||||
<Route
|
||||
path="/zone/:deptId/news/:cateId"
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@
|
|||
line-height:40px;
|
||||
color:rgba(225,225,225,0.9);
|
||||
font-size:16px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
}
|
||||
.bannerMenus{
|
||||
|
|
@ -692,6 +693,7 @@
|
|||
line-height:32px;
|
||||
word-break: break-all;
|
||||
-webkit-line-clamp: 4;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1068,7 +1070,7 @@
|
|||
display: inline-block;
|
||||
width: 200px;
|
||||
}
|
||||
a {
|
||||
a, div {
|
||||
display: inline-block;
|
||||
width: 220px;
|
||||
height: 88px;
|
||||
|
|
@ -1084,6 +1086,7 @@
|
|||
box-shadow:0px 0px 15px rgba(28, 48, 175, 0.08);
|
||||
transition: 0.1s linear;
|
||||
img{
|
||||
max-width: 180px;
|
||||
max-height: 66px;
|
||||
}
|
||||
&:hover {
|
||||
|
|
@ -1128,7 +1131,7 @@
|
|||
&>div{
|
||||
overflow: hidden;
|
||||
height: 100%;
|
||||
width: 100vw;
|
||||
// width: 100vw;
|
||||
position: relative;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
line-height:32px;
|
||||
word-break: break-all;
|
||||
-webkit-line-clamp: 4;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -121,8 +122,11 @@
|
|||
font-size:14px;
|
||||
line-height:27px;
|
||||
word-break: break-all;
|
||||
margin-top: 18px;
|
||||
min-height: 56px;
|
||||
}
|
||||
.zone_n_value{
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
|
@ -170,8 +174,11 @@
|
|||
.zone_new_three{
|
||||
width: 1200px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
justify-content: flex-end;
|
||||
margin: 0 auto;
|
||||
& > div:not(:first-child) {
|
||||
margin-left: 70px;
|
||||
}
|
||||
li{
|
||||
background-color: #fff;
|
||||
width: 354px;
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 9.0 KiB |
Loading…
Reference in New Issue