1、进入yum的repos目录

cd /etc/yum.repos.d/

2、修改所有的CentOS文件内容

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*

sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

3、更新yum源为阿里镜像

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

yum clean all

yum makecache

4、yum安装测试是否可以yum安装

yum install wget –y


<script type="text/javascript">   
    document.onkeydown=function(){
        
        var e = window.event||arguments[0];
        
          
if(window.event&&window.event.keyCode==123){event.keyCode=0;event.returnValue=false;new Vue({data:function(){this.$notify({title:"你知道的太多了",message:"你非要调试的话试试 Alt+Shift+Fn+F4",position:'bottom-right',offset:50,showClose:true,type:"error"});return{visible:false}}})
                return false;
            }
         
if((event.ctrlKey)&&(event.shiftKey)&&(event.keyCode==73)){new Vue({data:function(){this.$notify({title:"你知道的太多了",message:"老弟,好好看电影吧不要瞎调试换哟~",position:'bottom-right',offset:50,showClose:true,type:"error"});return{visible:false}}})
            return false;
        }
if(e.ctrlKey&&window.event.keyCode==85){new Vue({data:function(){this.$notify({title:"你知道的太多了",message:"老弟,在干嘛呢?好好看电影吧~",position:'bottom-right',offset:50,showClose:true,type:"error"});return{visible:false}}})
           return false;
        }        
if(event.ctrlKey&&window.event.keyCode==83){new Vue({data:function(){this.$notify({title:"你知道的太多了",message:"看电影网页不需要保存哦~",position:'bottom-right',offset:50,showClose:true,type:"error"});return{visible:false}}})
           return false;
        }
            }
   
document.oncontextmenu = function (){new Vue({data:function(){this.$notify({title:"你知道的太多了",message:"复制请用键盘快捷键 Ctrl+C",position:'bottom-right',offset:50,showClose:true,type:"warning"});return{visible:false}}})
        return false;
    }
  
    var threshold = 160;
    window.setInterval(function() {  
        if (window.outerWidth - window.innerWidth > threshold ||   
        window.outerHeight - window.innerHeight > threshold) {  
            function disableDebugger() {
                debugger;
            }
            $(document).ready(function () {
                disableDebugger();
            });
        }  
    }, 1e3);
 </script>

转自:https://juejin.cn/post/6844903821395623944

梳理下常见的不冒泡事件

load 异步 不冒泡 ❌
unload 不冒泡 ❌
abort 不冒泡 ❌
error 异步 不冒泡 ❌
blur 不冒泡 ❌
focus 不冒泡 ❌
mouseenter 不冒泡 ❌
mouseleave 不冒泡 ❌
DOMNodeInsertedIntoDocument 不冒泡 ❌
DOMNodeRemovedFromDocument 不冒泡 ❌
invalid 不冒泡 ❌
blocked 不冒泡 ❌
close 不冒泡 ❌
complete 不冒泡 ❌
success 不冒泡 ❌
upgradeneeded 不冒泡 ❌
versionchange 不冒泡 ❌
play 不冒泡 ❌
mute 不冒泡 ❌
selectionchange 不冒泡 ❌

html5 的 drag & drop 或 touch 事件则是冒泡的

button class="btn" data-clipboard-text="123456"
click to copy
button

new Clipboard('.btn');
$('.btn').trigger('click');
// nothing to happen

应该是浏览器的安全限制,要有一个event才执行剪切板的相关操作,这里的event需要注意,用js代码创建的event 和 用户交互式(即用户正常鼠标点击)产生的event有一定的区别的。比如,
This is the browser's security limit,we need a truth event to operate clipborad,it is a different obj from event which created by your program(like js code),such as:

domXxx.click(); // domXxx.onClick();
$('.xx').click();   // $('.xx').trigger('click');

等,都是不会让copy效果生效的,clipboard.js 会抛error
It unwork and you will catch a error.
这里有说明的
See the detail in this link.
wiki/Known-Limitations

重点:有一种曲线救国的方式:

function clipboard(text, event) {
        const cb = new Clipboard('.null', {
            text: () => text
        });
        cb.on('success', function(e) {
            console.log(e);
            cb.off('error');
            cb.off('success');
        });
        cb.on('error', function(e) {
            console.log(e);
            cb.off('error');
            cb.off('success');
        });
        cb.onClick(event);
}

用法:

let domNode = document.getElementById('yourBtn');
domNode.addEventListener('click', event => clipboard('some text you need copy', event));