找回密码
diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js
index e1220ce45..2ada6db67 100644
--- a/src/modules/tpm/NewHeader.js
+++ b/src/modules/tpm/NewHeader.js
@@ -1,7 +1,7 @@
-import React, { Component } from 'react';
+import React, { Component, Fragment } from 'react';
import { Link } from "react-router-dom";
import AccountProfile from "../user/AccountProfile";
-import { getImageUrl,getLogoImageUrl } from 'educoder';
+import { getImageUrl, getLogoImageUrl } from 'educoder';
import { getUserInfo } from 'src/military/expert/api';
import axios from 'axios';
import { Modal, Input, message, notification, Button, Popover, Badge } from 'antd';
@@ -25,7 +25,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)
@@ -54,7 +54,7 @@ class NewHeader extends Component {
settings: null,
goshowqqgtounp: false,
visiblemyss: false,
- visible:false, //浮动消息框展示控制
+ visible: false, //浮动消息框展示控制
}
}
componentDidMount() {
@@ -86,7 +86,7 @@ class NewHeader extends Component {
//获取游览器地址
try {
window.sessionStorage.setItem("yslgeturls", JSON.stringify(window.location.href))
- } catch (e) {}
+ } catch (e) { }
}
openNotification = (messge) => {
@@ -580,24 +580,24 @@ class NewHeader extends Component {
const hostname = window.location.hostname;
const port = window.location.port;
const isDev = hostname == "localhost";
- let isdev2= isDev ?'http://117.50.100.12:49999':`http://${hostname}`;
+ let isdev2 = isDev ? 'http://117.50.100.12:49999' : `http://${hostname}`;
let str = "";
- if(url.indexOf("http")>-1){
- if(url.indexOf("https")>-1){
+ if (url.indexOf("http") > -1) {
+ if (url.indexOf("https") > -1) {
isdev2 = `https://${hostname}`;
}
- if(!isDev && port){
- isdev2+=`:${port}`;
+ if (!isDev && port) {
+ isdev2 += `:${port}`;
}
- str = isdev2+match.path;
- }else{
+ str = isdev2 + match.path;
+ } else {
str = match.path;
}
- console.log(str,(url+"/"),url && str === url);
- if (url && (str === url || str===(url+"/"))) {
+ console.log(str, (url + "/"), url && str === url);
+ if (url && (str === url || str === (url + "/"))) {
return true
- }else {
+ } else {
return false
}
@@ -643,22 +643,22 @@ class NewHeader extends Component {
goshowqqgtounp: bool
})
}
- needAdd=(url)=> {
- let {current_user,mygetHelmetapi,history}=this.props;
+ needAdd = (url) => {
+ let { current_user, mygetHelmetapi, history } = this.props;
if (current_user.authentication || current_user.enterprise_certification) {
history.push('/needs/new')
} else {
Modal.confirm({
content: "请先完成实名认证再提交需求申请,是否前往认证?",
onOk() {
- window.location.href=`${mygetHelmetapi && mygetHelmetapi.main_web_site_url}/users/${current_user.login}/profiles`;
+ window.location.href = `${mygetHelmetapi && mygetHelmetapi.main_web_site_url}/users/${current_user.login}/profiles`;
}
})
}
}
render() {
- const { resetUserInfo , showNotification, match, current_user } = this.props;
+ const { resetUserInfo, showNotification, match, current_user } = this.props;
let { Addcoursestypes,
tojoinitemtype,
@@ -677,7 +677,7 @@ class NewHeader extends Component {
goshowqqgtounp,
visible,
} = this.state;
- let activeIndex =match.path === '/' || (match.path&&match.path.startsWith('/managements')) || (match.path&&match.path.startsWith('/admin'))?true: '';
+ let activeIndex = match.path === '/' || (match.path && match.path.startsWith('/managements')) || (match.path && match.path.startsWith('/admin')) ? true : '';
let headtypes = '/';
if (settings) {
if (settings.navbar) {
@@ -744,92 +744,92 @@ class NewHeader extends Component {
/> : ""}
{
goshowqqgtounp === true ?
-
this.setgoshowqqgtounp(bool)}>
- :""
+
this.setgoshowqqgtounp(bool)}>
+ : ""
}
-
+
{
settings && settings.nav_logo_url ?
-
- :
- ""
+
+ :
+ ""
}
{
settings && settings.navbar && settings.navbar.length > 0 ?
-
+ : ""
}
- {this.props.user && this.props.user.login &&
+ {this.props.user && this.props.user.login &&
}
{this.props.user && this.props.user.login &&
-
+
{
(coursestypes === true && this.props.user.main_site === false && (settings && !settings.add && (settings.add && settings.add.length === 0))) ? "" :
-
+
}
}
- { (settings && settings.common && settings.common.notice) && (current_user && current_user.login)?
+ {(settings && settings.common && settings.common.notice) && (current_user && current_user.login) ?
}
+ content={}
visible={visible}
onVisibleChange={this.handleVisibleChange}
destroyTooltipOnHide
@@ -837,7 +837,7 @@ class NewHeader extends Component {
{current_user &&
{/*
*/}
-
+
}
@@ -872,27 +872,31 @@ class NewHeader extends Component {
{user === undefined || user.login === "" ?
- this.educoderlogin()} className={`mr5 ${activeIndex ? 'color-home' : 'color-grey-6'}`}>登录
{
- // settings && settings.new_course && settings.new_course.register_url && (
- activeIndex ?
- :
- 注册
- // )
+ activeIndex ?
+
+ 登录
+
+
+ :
+
+ this.educoderlogin()} className={`mr5 color-grey-6`}>登录
+ 注册
+
}
:
{/*
*/}
-
-
+
+
{/* */}
- - {this.props.current_user.username}
+ - {this.props.current_user.username}
{
- settings && settings.personal && settings.personal.length > 0 && settings.personal.map((item,key)=>{
- return(
+ settings && settings.personal && settings.personal.length > 0 && settings.personal.map((item, key) => {
+ return (
- {item.name}
)
})