function copyFun () {
if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
console.log('ios')
window.getSelection().removeAllRanges();
var Url2 = document.getElementById("copy");
var range = document.createRange();
range.selectNode(Url2);
window.getSelection().addRange(range);
var successful = document.execCommand('copy');
window.getSelection().removeAllRanges();
} else {
var text = document.getElementById("copy").innerText;
const textarea = document.createElement("textarea");
textarea.style.position = 'fixed';
textarea.style.top = 0;
textarea.style.left = 0;
textarea.style.border = 'none';
textarea.style.outline = 'none';
textarea.style.resize = 'none';
textarea.style.background = 'transparent';
textarea.style.color = 'transparent';
textarea.value = text;
document.body.appendChild(textarea);
textarea.select()
try {
const msg = document.execCommand('copy') ?
'successful' : 'unsuccessful';
console.log("复制成功");
} catch (err) {
alert('unable to copy', err);
console.log("复制失败");
}
document.body.removeChild(textarea)
}
},