This commit is contained in:
caishi 2022-04-12 14:26:21 +08:00
parent f75b4b73da
commit 600cef8826
1 changed files with 2 additions and 1 deletions

View File

@ -22,6 +22,7 @@ const $ = window.$
const { Search } = Input;
window._header_componentHandler = null;
// 非trustie链接则新开页跳转
const isPath= window.location.hostname ==='code.educoder.net' || window.location.hostname==='testforgeplus.educoder.net';
const str = ['www.trustie.net','forgeplus.trustie.net','forum.trustie.net','testforgeplus.trustie.net']
class NewHeader extends Component {
constructor(props) {
@ -432,7 +433,7 @@ class NewHeader extends Component {
var waiLian = (new_link && str.filter(item=>new_link.indexOf(item)>-1) );
var wl = waiLian && waiLian.length>0;
return (
<li key={key} onClick={() => this.headtypesonClick(item.link, true)} className={`${this.matchpaths(item.link) === true ? 'pr active' : 'pr'}`} style={!is_hidden ? { display: 'flex' } : { display: 'none' }}>
<li key={key} onClick={() => this.headtypesonClick(item.link, true)} className={`${((isPath && item.name === "大学开源") || this.matchpaths(item.link) === true) ? 'pr active' : 'pr'}`} style={!is_hidden ? { display: 'flex' } : { display: 'none' }}>
<a href={new_link} target={wl ? "_self":"_blank"}><div dangerouslySetInnerHTML={{ __html: item.name }}></div></a>
</li>
)