From 6eac291a0c381867c048a7b54b09cfb85d492100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 4 Jul 2019 17:42:15 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/Listofworks.js | 39 +++++-------------- .../shixunHomework/Trainingjobsetting.js | 32 ++++----------- .../shixunHomework/Workquestionandanswer.js | 32 ++++----------- 3 files changed, 25 insertions(+), 78 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index 9606740dc..a720cffd4 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -1350,21 +1350,10 @@ class Listofworks extends Component { },{responseType: 'blob'}).then((response) => { console.log("1342"); console.log(response); - if (response.status == 200) { - - var blob = new Blob([response.data]) - var downloadElement = document.createElement('a'); - var href = window.URL.createObjectURL(blob); //创建下载的链接 - let filename = response.headers.get('Content-Disposition'); - if (filename) { - filename = filename.match(/\"(.*)\"/)[1]; //提取文件名 - downloadElement.href = href; - downloadElement.download = filename; //下载后文件名 - document.body.appendChild(downloadElement); - downloadElement.click(); //点击下载 - document.body.removeChild(downloadElement); //下载完成移除元素 - } - window.URL.revokeObjectURL(href); //释放掉blob对象 + if(response.status === 200){ + window.open(url, '_blank'); + }else{ + } }).catch((error) => { console.log(error) @@ -1384,21 +1373,11 @@ class Listofworks extends Component { },{responseType: 'blob'}).then((response) => { console.log("1306"); console.log(response); - if (response.status == 200) { - var blob = new Blob([response.data]) - var downloadElement = document.createElement('a'); - var href = window.URL.createObjectURL(blob); //创建下载的链接 - let filename = response.headers.get('Content-Disposition'); - if (filename) { - filename = filename.match(/\"(.*)\"/)[1]; //提取文件名 - downloadElement.href = href; - downloadElement.download = filename; //下载后文件名 - document.body.appendChild(downloadElement); - downloadElement.click(); //点击下载 - document.body.removeChild(downloadElement); //下载完成移除元素 - } - window.URL.revokeObjectURL(href); //释放掉blob对象 - } + if(response.status === 200){ + window.open(url, '_blank'); + }else{ + + } }).catch((error) => { console.log(error) }); diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 19343ad79..f67eca6ab 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1619,19 +1619,11 @@ class Trainingjobsetting extends Component { },{responseType: 'blob'}).then((response) => { console.log("326"); console.log(response); - var blob = new Blob([response.data]) - var downloadElement = document.createElement('a'); - var href = window.URL.createObjectURL(blob); //创建下载的链接 - let filename = response.headers.get('Content-Disposition'); - if (filename) { - filename = filename.match(/\"(.*)\"/)[1]; //提取文件名 - downloadElement.href = href; - downloadElement.download = filename; //下载后文件名 - document.body.appendChild(downloadElement); - downloadElement.click(); //点击下载 - document.body.removeChild(downloadElement); //下载完成移除元素 + if(response.status === 200){ + window.open(url, '_blank'); + }else{ + } - window.URL.revokeObjectURL(href); //释放掉blob对象 }).catch((error) => { console.log(error) @@ -1646,19 +1638,11 @@ class Trainingjobsetting extends Component { axios.get((url),{responseType: 'blob'}).then((response) => { console.log("339"); console.log(response); - var blob = new Blob([response.data]) - var downloadElement = document.createElement('a'); - var href = window.URL.createObjectURL(blob); //创建下载的链接 - let filename = response.headers.get('Content-Disposition'); - if (filename) { - filename = filename.match(/\"(.*)\"/)[1]; //提取文件名 - downloadElement.href = href; - downloadElement.download = filename; //下载后文件名 - document.body.appendChild(downloadElement); - downloadElement.click(); //点击下载 - document.body.removeChild(downloadElement); //下载完成移除元素 + if(response.status === 200){ + window.open(url, '_blank'); + }else{ + } - window.URL.revokeObjectURL(href); //释放掉blob对象 }).catch((error) => { console.log(error) diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js index d341aab6b..ab650aae2 100644 --- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js +++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js @@ -330,19 +330,11 @@ class Workquestionandanswer extends Component { },{responseType: 'blob'}).then((response) => { console.log("326"); console.log(response); - var blob = new Blob([response.data]) - var downloadElement = document.createElement('a'); - var href = window.URL.createObjectURL(blob); //创建下载的链接 - let filename = response.headers.get('Content-Disposition'); - if (filename) { - filename = filename.match(/\"(.*)\"/)[1]; //提取文件名 - downloadElement.href = href; - downloadElement.download = filename; //下载后文件名 - document.body.appendChild(downloadElement); - downloadElement.click(); //点击下载 - document.body.removeChild(downloadElement); //下载完成移除元素 + if(response.status === 200){ + window.open(url, '_blank'); + }else{ + } - window.URL.revokeObjectURL(href); //释放掉blob对象 }).catch((error) => { console.log(error) @@ -357,19 +349,11 @@ class Workquestionandanswer extends Component { axios.get((url),{responseType: 'blob'}).then((response) => { console.log("339"); console.log(response); - var blob = new Blob([response.data]) - var downloadElement = document.createElement('a'); - var href = window.URL.createObjectURL(blob); //创建下载的链接 - let filename = response.headers.get('Content-Disposition'); - if (filename) { - filename = filename.match(/\"(.*)\"/)[1]; //提取文件名 - downloadElement.href = href; - downloadElement.download = filename; //下载后文件名 - document.body.appendChild(downloadElement); - downloadElement.click(); //点击下载 - document.body.removeChild(downloadElement); //下载完成移除元素 + if(response.status === 200){ + window.open(url, '_blank'); + }else{ + } - window.URL.revokeObjectURL(href); //释放掉blob对象 }).catch((error) => { console.log(error) From 84c51989a1261debdd9db3696c9421c1ea8c4763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 4 Jul 2019 17:43:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/tpm/challengesnew/css/TPMchallengesnew.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/challengesnew/css/TPMchallengesnew.css b/public/react/src/modules/tpm/challengesnew/css/TPMchallengesnew.css index fb23ba4b8..5087e2f0d 100644 --- a/public/react/src/modules/tpm/challengesnew/css/TPMchallengesnew.css +++ b/public/react/src/modules/tpm/challengesnew/css/TPMchallengesnew.css @@ -60,7 +60,7 @@ a{ #exercisememoMD .CodeMirror { margin-top: 31px !important; - height: 374px !important; + height: 658px !important; /*width: 579px !important;*/ } From cb96cd2b420366558e864a77dcb48e081897054a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 4 Jul 2019 17:54:18 +0800 Subject: [PATCH 3/3] =?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/user/FindPasswordComponent.js | 2 +- public/react/src/modules/user/LoginRegisterComponent.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/user/FindPasswordComponent.js b/public/react/src/modules/user/FindPasswordComponent.js index 2fe5df943..2fed8f3a8 100644 --- a/public/react/src/modules/user/FindPasswordComponent.js +++ b/public/react/src/modules/user/FindPasswordComponent.js @@ -402,7 +402,7 @@ class LoginRegisterComponent extends Component { :
}