hjm 5 years ago
commit ab40ef1905

@ -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,20 +1373,10 @@ 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)

@ -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); //下载完成移除元素
}
window.URL.revokeObjectURL(href); //释放掉blob对象
if(response.status === 200){
window.open(url, '_blank');
}else{
}
}).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); //下载完成移除元素
}
window.URL.revokeObjectURL(href); //释放掉blob对象
if(response.status === 200){
window.open(url, '_blank');
}else{
}
}).catch((error) => {
console.log(error)

@ -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); //下载完成移除元素
}
window.URL.revokeObjectURL(href); //释放掉blob对象
if(response.status === 200){
window.open(url, '_blank');
}else{
}
}).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); //下载完成移除元素
}
window.URL.revokeObjectURL(href); //释放掉blob对象
if(response.status === 200){
window.open(url, '_blank');
}else{
}
}).catch((error) => {
console.log(error)

@ -60,7 +60,7 @@ a{
#exercisememoMD .CodeMirror {
margin-top: 31px !important;
height: 374px !important;
height: 658px !important;
/*width: 579px !important;*/
}

@ -402,7 +402,7 @@ class LoginRegisterComponent extends Component {
: <div style={{height: "25px"}}></div>
}
<DragValidator
height={38} successGreenColor="#b0e811"
height={38} successGreenColor="#29bd8b"
style={{height: "38px", width: "100%"}}
dragOkCallback={this.dragOkCallback}
></DragValidator>

@ -713,7 +713,7 @@ class LoginRegisterComponent extends Component {
}
<DragValidator
height={38} className="loginInput" successGreenColor="#b0e811"
height={38} className="loginInput" successGreenColor="#29bd8b"
style={{ height: '38px'}}
dragOkCallback={this.dragOkCallback}
></DragValidator>

Loading…
Cancel
Save