Browse Source

commit

master
hehongxing 3 years ago
parent
commit
9fccc26b1c
  1. 2
      04.系统编码/Backend/src/main/resources/application.yml
  2. 21
      04.系统编码/Frontend/src/components/MicrowaveRadiation.vue

2
04.系统编码/Backend/src/main/resources/application.yml

@ -2,7 +2,7 @@ server:
port: 8002
spring:
datasource:
url: jdbc:mysql://${custom.parent-url}:33306/user_information?useUnicode=true&characteEncoding=utf-8
url: jdbc:mysql://112.124.40.88:33306/user_information?useUnicode=true&characteEncoding=utf-8
username: root
password: 3cqscbr@only1
# url: jdbc:mysql://10.124.102.10:3306/user_information?useUnicode=true&characteEncoding=utf-8

21
04.系统编码/Frontend/src/components/MicrowaveRadiation.vue

@ -69,7 +69,7 @@
<div class="btns-group">
<span @click="onPlayClick">{{isPlay ? '暂停动画' : '播放动画'}}</span>
<a @click="onDownloadClick">下载动画</a> <!-- :href=""-->
<a id="weboDownload" :download='downloadSrc' :href='downloadSrc'>下载隐藏层</a>
<a id="weboDownload" download :href='downloadSrc' style="display: none;">下载隐藏层</a>
</div>
</div>
<div class="picture-view">
@ -203,16 +203,25 @@ import { post } from '../uilts/axios';
}
const onDownloadClick = () => {
post("/image/createGif", prepareParams(), 'application/json').then((response: any) => {
if (response.error != 0){
console.log(response.message);
return;
}
options.downloadSrc = response.data;
console.log(response.data);
document.getElementById("weboDownload").click();
fetch(response.data).then(res => {
return res.blob();
}).then(blob => {
let reader = new FileReader();
reader.onloadend = function(){
options.downloadSrc = reader.result;
setTimeout(() => {
document.getElementById("weboDownload").click();
options.downloadSrc = null;
}, 500);
};
reader.readAsDataURL(blob);
}).catch(console.error);
})
}

Loading…
Cancel
Save