This commit is contained in:
caishi 2023-07-10 09:43:54 +08:00
commit e0daa3ad0a
12 changed files with 34 additions and 15 deletions

File diff suppressed because one or more lines are too long

View File

@ -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

View File

@ -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>
)

View File

@ -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>
)
})

View File

@ -44,7 +44,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">

View File

@ -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 &&

View File

@ -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 &&

View File

@ -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>

View File

@ -109,7 +109,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"

View File

@ -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%;

View File

@ -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;

BIN
src/images/img-error.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB