ocument.cookie = ck_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 = ck_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 < ca.length; i++) { var c = ca[i].trim(); if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } })