Merge pull request #269 from ckcz123/v2.0

copy on iOS
This commit is contained in:
Zhang Chen 2018-12-01 22:38:27 +08:00 committed by GitHub
commit e19dffd52f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -648,7 +648,12 @@ utils.prototype.download = function (filename, content) {
// Step 1: 如果是iOS平台直接不支持 // Step 1: 如果是iOS平台直接不支持
if (core.platform.isIOS) { if (core.platform.isIOS) {
if (core.copy(content)) {
alert("iOS平台下不支持直接下载文件\n所有应下载内容已经复制到您的剪切板请自行创建空白文件并粘贴。");
}
else {
alert("iOS平台下不支持下载操作"); alert("iOS平台下不支持下载操作");
}
return; return;
} }
@ -671,7 +676,6 @@ utils.prototype.download = function (filename, content) {
var blob = new Blob([content], {type: 'text/plain;charset=utf-8'}); var blob = new Blob([content], {type: 'text/plain;charset=utf-8'});
var href = window.URL.createObjectURL(blob); var href = window.URL.createObjectURL(blob);
var opened=window.open(href, "_blank"); var opened=window.open(href, "_blank");
// if (!opened) window.location.href=href;
window.URL.revokeObjectURL(href); window.URL.revokeObjectURL(href);
return; return;
} }