diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js
index 075278079..850a3cc99 100644
--- a/src/forge/Head/Header.js
+++ b/src/forge/Head/Header.js
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import AccountProfile from "../../modules/user/AccountProfile";
import { getImageUrl } from 'educoder'
import axios from 'axios';
-import { Input , notification , Dropdown , Menu, Divider } from 'antd';
+import { Input, notification, Dropdown, Menu, Divider } from 'antd';
import LoginDialog from '../../modules/login/LoginDialog';
import AddProjectModal from './AddProjectModal';
import '../../modules/tpm/TPMIndex.css';
@@ -15,7 +15,7 @@ let old_url;
window._header_componentHandler = null;
// 非trustie链接则新开页跳转
-const str = ['www.trustie.net','forgeplus.trustie.net','forum.trustie.net','testforgeplus.trustie.net']
+const str = ['www.trustie.net', 'forgeplus.trustie.net', 'forum.trustie.net', 'testforgeplus.trustie.net']
class NewHeader extends Component {
constructor(props) {
super(props)
@@ -41,7 +41,7 @@ class NewHeader extends Component {
headtypess: "/",
settings: null,
visiblemyss: false,
- openSearch:false,
+ openSearch: false,
}
}
componentDidMount() {
@@ -72,38 +72,38 @@ class NewHeader extends Component {
//获取游览器地址
try {
window.sessionStorage.setItem("yslgeturls", JSON.stringify(window.location.href))
- } catch (e) {}
+ } catch (e) { }
}
- SearchInput = (open,item)=>{
- if(open){
- return(
+ SearchInput = (open, item) => {
+ if (open) {
+ return (
{
setTimeout(() => {
this.setState({
- openSearch:false
+ openSearch: false
})
}, 300)
}}
>
this.onGlobalSearch(value,item)}
+ onSearch={(value) => this.onGlobalSearch(value, item)}
autoFocus={true}
- style={{width:"260px"}}
+ style={{ width: "260px" }}
/>
)
- }else{
+ } else {
return {
- this.setState({openSearch:true})
+ this.setState({ openSearch: true })
}} />
}
}
- onGlobalSearch=(value,item)=>{
- window.location.href=`${item}?value=` + value;
+ onGlobalSearch = (value, item) => {
+ window.location.href = `${item}?value=` + value;
}
openNotification = (messge) => {
@@ -246,61 +246,62 @@ class NewHeader extends Component {
matchpaths = (url) => {
const { match } = this.props;
- if(url){
- if (match.path.indexOf(url) > -1) {
+ if (url) {
+ // if (match.path.indexOf(url) > -1) {
+ if (match.path == url) {
return true
- }else {
+ } else {
return false
}
}
}
- addMenu=(list)=>{
- return(
- list && list.length >0 &&
+ addMenu = (list) => {
+ return (
+ list && list.length > 0 &&
-
)
}
- renderMenu=(personal)=>{
+ renderMenu = (personal) => {
const { current_user } = this.props;
- return(
+ return (
{current_user && current_user.username}
- {
- personal && personal.length > 0 && personal.map((item,key)=>{
- return(
- {item.name}
- )
- })
- }
+ {
+ personal && personal.length > 0 && personal.map((item, key) => {
+ return (
+ {item.name}
+ )
+ })
+ }
this.educoderloginysl()}>退出
)
}
- menus=(item)=>{
- return(
+ menus = (item) => {
+ return (
{
- item.map((i,k)=>{
- return(
- !i.hidden &&
{window.location.href=this.checkLink(i.link)}}>
- {k!==0 &&}
+ item.map((i, k) => {
+ return (
+ !i.hidden && { window.location.href = this.checkLink(i.link) }}>
+ {k !== 0 && }
- {i.content}
+ {i.content}
)
})
@@ -309,7 +310,7 @@ class NewHeader extends Component {
)
}
- checkLink=(link)=>{
+ checkLink = (link) => {
let { settings, } = this.state;
if (link) {
if (link.indexOf("http") > -1) {
@@ -323,7 +324,7 @@ class NewHeader extends Component {
}
render() {
- const { match} = this.props;
+ const { match } = this.props;
let current_user = this.props.user;
let { Addcoursestypes,
tojoinitemtype,
@@ -431,78 +432,78 @@ class NewHeader extends Component {
{...this.props}
{...this.state}
/> : ""}
- {
- settings && settings.nav_logo_url ?
-
+ {
+ settings && settings.nav_logo_url ?
+
:
""
- }
+ }
{
settings && settings.navbar && settings.navbar.length > 0 ?
-
+ : ""
}
- {search_url ? this.SearchInput(openSearch,search_url):""}
+ {search_url ? this.SearchInput(openSearch, search_url) : ""}
{
- current_user && (current_user.main_site || current_user.login) && (settings && settings.add && settings.add.length>0)?
-
-
- :""
+ current_user && (current_user.main_site || current_user.login) && (settings && settings.add && settings.add.length > 0) ?
+
+
+ : ""
}
-
+
{this.props.user && this.props.user.login && notice_url ?
{user && user.login &&
@@ -512,10 +513,10 @@ class NewHeader extends Component {
}
-
:""
+
: ""
}
- {!user || (user && !user.login) ?
+ {!user || (user && !user.login) ?
{(settings && settings.sso_login_url) ? 使用学校统一认证登录 :
this.educoderlogin()} className="mr5 color-white">登录
@@ -527,7 +528,7 @@ class NewHeader extends Component {
:
-
+
diff --git a/src/forge/Main/Index.js b/src/forge/Main/Index.js
index 625c59a21..8ccf5e7f2 100644
--- a/src/forge/Main/Index.js
+++ b/src/forge/Main/Index.js
@@ -353,7 +353,7 @@ class Index extends Component {
{current_user && current_user.login &&
-
+
新建