From 38670e7e003e0ca0398a7bb5400b9ddaca4932e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 15 Oct 2019 11:28:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMIndexHOC.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index 598ef4892..b7c0ed1f2 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -282,17 +282,15 @@ export function TPMIndexHOC(WrappedComponent) { // // } + //获取当前定制信息 //获取当前定制信息 getAppdata=()=>{ let url = "/setting.json"; - axios.get(url,{ - - }).then((response) => { - console.log("开始请求/setting.json"); + axios.get(url).then((response) => { + console.log("app.js开始请求/setting.json"); console.log("获取当前定制信息"); - console.log(response); - if(response!=undefined){ - if(response.status===200){ + if(response){ + if(response.data){ this.setState({ mygetHelmetapi:response.data.setting }); @@ -306,7 +304,7 @@ export function TPMIndexHOC(WrappedComponent) { document.head.removeChild(oldLink); } document.head.appendChild(link); - }else{ + }else { document.title = "EduCoder"; var link = document.createElement('link'), oldLink = document.getElementById('dynamic-favicon'); @@ -318,6 +316,7 @@ export function TPMIndexHOC(WrappedComponent) { } document.head.appendChild(link); } + }else{ document.title = "EduCoder"; var link = document.createElement('link'), @@ -332,7 +331,6 @@ export function TPMIndexHOC(WrappedComponent) { } }).catch((error) => { - console.log(error); document.title = "EduCoder"; var link = document.createElement('link'), oldLink = document.getElementById('dynamic-favicon');