if(getCookie('xuebihua.cc_wechat_key') != ''){ window.open($(this).data('link')); }else{ $('.wechat_box').show(); link = $(this).data('link'); /*setTimeout(function(){ $('.wechat_btn').addClass('wechat_key').css('background-color', '#f00'); $('.wechat_btn a').attr('href', link).attr('target', '_blank'); let date = new Date(); date.setTime(date.getTime()+(60*60*1000)); let expires = "expires="+date.toGMTString(); document.cookie = "xuebihua.cc_wechat_key=wechat_value; "+expires; } ,parseInt(Math.random() * (15 - 10 + 1) + 10) * 1000);*/ } }); $('.wechat_btn a').click(function(){ let gain = $('#check').val(); if(gain === pass){ let date = new Date(); date.setTime(date.getTime()+(60*60*1000)); let expires = "expires="+date.toGMTString(); document.cookie = "xuebihua.cc_wechat_key=wechat_value; "+expires; window.open(link); }else{ layer.msg('密码错误'); } }); function getCookie(cname){ var name = cname + "="; var ca = document.cookie.split(';'); for(var i=0; i