讨逆猴子剪切板,复制失败?
问题:本地开发情况下可以直接复制,公网就不行了…触发了安全机制。

const link = `内容`;
navigator.clipboard.writeText(link);
报错:

解决方案:
if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard.writeText(link);
this.$message.success('链接已复制到剪贴板');
} else {
// document.execCommand('copy') 向剪贴板写文本
let input = document.createElement('input')
input.style.position = 'fixed'
input.style.top = '-10000px'
input.style.zIndex = '-999'
document.body.appendChild(input)
input.value = link
input.focus()
input.select()
let result = document.execCommand('copy');
document.body.removeChild(input);
this.$message.success('链接已复制到剪贴板');
}





![GB28181摄像头管理平台WVP视频平台SQL注入漏洞复现 [附POC]](https://i-blog.csdnimg.cn/direct/d211dc2c91d54f47b34464e61b04c4e1.png)








![[论文笔记]一种超越思维链的提示策略——少到多提示](https://img-blog.csdnimg.cn/img_convert/7276b2e267f28044966a28327e5677fc.png)




