From d029840874568f2d4d5439d0203b3d5c2b87b999 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 14 May 2021 11:30:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=B4=E9=83=A8=E5=AF=BC=E8=88=AA=E6=A0=8F?= =?UTF-8?q?=E6=97=A0logo=E6=98=AFnav=E4=B9=9F=E8=A6=81=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/css/edu-all.css | 72 ----------------- public/css/edu-purge.css | 2 +- src/forge/Head/Header.js | 165 +++------------------------------------ 3 files changed, 13 insertions(+), 226 deletions(-) diff --git a/public/css/edu-all.css b/public/css/edu-all.css index b8a558075..6485f2316 100644 --- a/public/css/edu-all.css +++ b/public/css/edu-all.css @@ -38,78 +38,6 @@ box-sizing: border-box; } -.head-nav ul#header-nav li { - float: left; - height: 60px; - line-height: 60px; - margin-right: 30px; - cursor: pointer; - position: relative; - font-size: 16px -} - -.head-nav ul#header-nav li a { - display: block; - height: 100%; - width: 100%; - color: #fff -} - -.head-nav ul#header-nav li a:hover { - color: #cccccc; -} - -.head-nav ul#header-nav li:last-child { - margin-right: 0px -} - -.head-nav ul#header-nav li.active a { - color: #459be5 !important; -} - -.head-nav ul#header-nav li.active p { - color: #459be5 !important; -} - -.head-nav ul#header-nav li p:hover { - color: #cccccc; -} - -.head-nav ul#header-nav li p { - display: block; - height: 100%; - width: 100%; - color: #fff -} - -.head-nav ul#header-nav li.active div ul li a { - color: #000 !important; -} - -.head-nav ul#header-nav li.active div ul li a:hover { - color: #FFF !important; -} - -.head-nav ul#header-nav li.active ul li a { - color: #000 !important; -} - -.head-nav ul#header-nav li.active ul li a:hover { - color: #FFF !important; -} - -.head-nav ul#header-nav li.active:after { - content: ''; - position: absolute; - left: 0px; - top: auto; - bottom: 10px; - right: auto; - height: 2px; - width: 14px; - background-color: #459be5; -} - .nav-img { position: absolute; top: 2px; diff --git a/public/css/edu-purge.css b/public/css/edu-purge.css index 19fbc1a9b..4d59fc11f 100644 --- a/public/css/edu-purge.css +++ b/public/css/edu-purge.css @@ -3934,7 +3934,7 @@ html>body #ajax-indicator { cursor: pointer; position: relative; font-size: 16px; - padding:0px 20px; + padding-right:40px; } .head-nav ul#header-nav li a { diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js index 043e53233..4d55f824c 100644 --- a/src/forge/Head/Header.js +++ b/src/forge/Head/Header.js @@ -51,7 +51,6 @@ class NewHeader extends Component { } } componentDidMount() { - // this.getAppdata(); this.geturlsdata(); window._header_componentHandler = this; @@ -130,120 +129,6 @@ class NewHeader extends Component { old_url = newProps.Headertop.old_url } } - getCookie = (key) => { - var arr, reg = RegExp('(^| )' + key + '=([^;]+)(;|$)'); - if (arr === document.cookie.match(reg)) - return decodeURIComponent(arr[2]); - else - return null; - } - - delCookie = (name) => { - var exp = new Date(); - exp.setTime(exp.getTime() - 1); - var cval = this.getCookie(name); - if (cval != null) { - document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString(); - } - } - onLogout = () => { - const url = `/accounts/logout.json` - this.delCookie("autologin_trustie") - axios.get(url, { - }).then((response) => { - if (response.data.status === 1) { - this.setState({ - user: undefined - }) - window.location.href = "/login" - message.success('退出成功'); - } - }); - } - - tojoinclass = () => { - let { user } = this.state; - if (user === undefined) { - this.setState({ - isRender: true - }) - return - } - if (user && user.login === "") { - this.setState({ - isRender: true - }) - return; - } - if (user && user.profile_completed === false) { - this.setState({ - AccountProfiletype: true - }) - return; - } - this.setState({ - Addcoursestypes: true, - }) - } - - tojoinitem = () => { - if (this.props.user && this.props.user.email === undefined || this.props.user && this.props.user.email === null || this.props.user && this.props.user.email === "") { - this.openNotification("请先绑定邮箱,谢谢"); - return - } - let { user } = this.state; - if (user === undefined) { - this.setState({ - isRender: true - }) - return - } - if (user && user.login === "") { - this.setState({ - isRender: true - }) - return; - } - - if (user && user.profile_completed === false) { - this.setState({ - AccountProfiletype: true - }) - return; - } - - this.setState({ - tojoinitemtype: true - }) - } - - - submitstatevalue = (sum, value, data) => { - this.setState({ - Addcoursestypes: false, - tojoinitemtype: false, - tojoinclasstitle: undefined, - rolearr: ["", ""], - Checkboxteacherchecked: false, - Checkboxstudentchecked: false, - Checkboxteachingchecked: false, - Checkboxteachertype: false, - Checkboxteachingtype: false, - code_notice: false, - checked_notice: false, - submitapplicationssum: sum, - submitapplications: true, - submitapplicationsvalue: value, - submitapplicationsvaluedata: data, - RadioGroupvalue: undefined - }) - } - - onChangeRadioGroup = (e) => { - this.setState({ - RadioGroupvalue: e.target.value, - }); - } submitsubmitapplications = () => { let { @@ -402,39 +287,13 @@ class NewHeader extends Component { }) } - getAppdata = () => { - try { - var chromesettingArray = JSON.parse(localStorage.getItem('chromesetting')); - var chromesettingresponseArray = JSON.parse(localStorage.getItem('chromesettingresponse')); - this.setState({ - settings: chromesettingArray - }); - if (chromesettingArray.tab_logo_url) { - this.gettablogourldata(chromesettingresponseArray); - } else { - this.gettablogourlnull(); - } - } catch (e) { - this.geturlsdata(); - } - }; - geturlsdata = () => { let url = "/setting.json"; axios.get(url).then((response) => { if (response && response.data) { this.setState({ settings: response.data.setting }); - // localStorage.setItem('chromesetting', JSON.stringify(response.data.setting)); - // localStorage.setItem('chromesettingresponse', JSON.stringify(response)); - try { - if (response.data.setting.tab_logo_url) { - this.gettablogourldata(response); - } else { - this.gettablogourlnull(); - } - } catch (e) { - this.gettablogourlnull(); - } + localStorage.setItem('chromesetting', JSON.stringify(response.data.setting)); + localStorage.setItem('chromesettingresponse', JSON.stringify(response)); } else { this.gettablogourlnull(); } @@ -555,7 +414,7 @@ class NewHeader extends Component { let shixun = "/shixuns"; let paths = "/paths"; let courses = "/courses"; - this.props.mygetHelmetapi.navbar.map((item, key) => { + this.props.mygetHelmetapi && this.props.mygetHelmetapi.navbar && this.props.mygetHelmetapi.navbar.map((item, key) => { var reg = RegExp(item.link); if (shixun.match(reg)) { if (item.hidden === true) { @@ -593,19 +452,19 @@ class NewHeader extends Component { {...this.props} {...this.state} /> : ""} - { - goshowqqgtounp === true ? - this.setgoshowqqgtounp(bool)}> - :"" - } - + { + goshowqqgtounp === true ? + this.setgoshowqqgtounp(bool)}> + :"" + } { settings && settings.nav_logo_url ? - 可控开源社区 + + 可控开源社区 + : - 可控开源社区 + "" } -
{ settings && settings.navbar && settings.navbar.length > 0 ?