Skip to content

Commit

Permalink
add ios screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Apr 15, 2019
1 parent 62f59fe commit edc2ef8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions templates/remotecontrol_apple.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
</span>
</el-dialog>

<el-button size="mini" @click="screenshot">截图</el-button>
</div>
</div>

Expand Down Expand Up @@ -341,6 +342,24 @@
}
},
methods: {
screenshot() {
$.ajax({
url: this.path2url("/screenshot"),
dataType: "json",
}).then(ret => {
if (window.navigator.msSaveOrOpenBlob) {
alert("IE is not supported !!!")
return
}
var a = document.createElement("a");
a.href = "data:image/jpeg;base64," + ret.value;
a.download = "screen-" + new Date().getTime() + ".jpg";
a.click();
setTimeout(function () {
document.body.removeChild(a);
}, 0);
})
},
appOpen(bundleId) {
return $.ajax({
method: "post",
Expand Down

0 comments on commit edc2ef8

Please sign in to comment.