微信域名被封如何查询检测?

在当今数字化营销领域,社交媒体平台,尤其是微信,已成为企业引流与品牌推广的核心渠道。然而,运营过程中一个常见且棘手的问题是:域名在微信内访问时遭遇封禁。这通常表现为链接在聊天窗口或朋友圈打开时,被提示“已停止访问该网页”或“网页包含不安全内容”。那么,如何有效查询和检测域名在微信内的状态呢?这背后涉及一系列技术逻辑与生态规则。


**一、域名被封的定义与微信生态的规则框架** 微信域名被封,本质上是指特定URL被微信安全风控系统判定为违规,从而在微信内置浏览器(X5内核)中被拦截访问。微信构建了一个相对封闭的生态体系,出于用户体验、内容安全及商业策略的考量,其安全团队会依据《微信外部链接内容管理规范》对分享链接进行严格审查。触发封禁的原因多样,主要包括:诱导分享(如强制转发)、欺诈信息、色情低俗内容、未取得许可证的在线销售、频繁被投诉,以及使用被多次违规关联的域名或短链服务。
**二、查询与检测的技术实现原理与常用方法** 检测域名在微信内的状态,并非直接向微信官方查询“黑名单”,而是通过模拟微信环境发起访问请求,并解析返回的结果页面或状态码来实现。其技术核心在于识别微信的特定拦截页面特征。 1. **直接访问检测法**:最基础的方法是在手机微信内直接点击链接,观察是否出现拦截提示。但这种方法效率低,不适合批量检测。 2. **API检测工具原理**:市面上专业的检测工具,其后台实现通常基于以下流程: * **环境模拟**:工具服务器通过程序模拟微信客户端的HTTP请求头(User-Agent包含MicroMessenger/标识),向目标域名发起访问。 * **响应分析**:工具会完整抓取服务器返回的HTML内容。微信的拦截页面具有高度一致的HTML特征码,例如页面中包含特定的标签(如“已停止访问该网页”)、特定的div结构或提示文案。 * **结果判定**:检测程序通过正则表达式或关键词匹配,在抓取的内容中搜索这些特征码。一旦匹配成功,即判定为“被封”或“疑似被封”。同时,工具也会检查HTTP状态码(如302重定向到微信安全提示页)作为辅助判断依据。 <img class='ue-image' width='100%' src='http://zyplace.cn/assets/img/random/244.jpg'> 3. **在线批量检测平台**:这些平台将上述技术封装成友好界面,允许用户输入大量域名进行并发检测,并在秒级内返回“正常”、“被封”、“不稳定”等状态报告。部分高级工具还提供历史记录、监控预警等功能。 <hr> **三、技术架构与风控系统的潜在风险隐患** 构建或使用这类检测工具,需理解其背后的技术架构与伴随的风险。工具本身通常由请求调度模块、特征码规则库、结果解析引擎和报告生成模块组成。然而,频繁、高并发地向同一个域名发起模拟微信的请求,可能被目标服务器的安全系统识别为CC攻击或恶意扫描,导致检测工具自身IP被封。此外,微信的安全风控规则是动态更新且不公开的,拦截页面的特征码也可能微调,这就要求检测工具的规则库必须持续维护,否则会出现误判。 对于用户而言,最大的风险在于“误判”和“依赖滞后”。工具检测结果并非微信官方判决,存在小概率误差。同时,检测是瞬时状态,无法预测未来几分钟后域名是否会被封。域名状态可能在检测完成后立即发生变化。 <hr> **四、主动应对措施与防御性推广策略** 面对域名被封风险,被动检测不如主动防御。 1. **内容合规是根基**:严格遵守微信官方规则,杜绝任何违规诱导、虚假宣传和敏感内容。这是最根本、最长效的防御策略。 2. **域名与链接管理策略**: * **多域名轮换**:准备多个备案且内容健康的域名作为主域名的“备胎”,一旦主域名被封,可快速切换。避免将所有流量入口绑定在单一域名上。 * **使用短链中转**:考虑使用自有或可靠的第三方短链服务。一方面可以隐藏真实域名,另一方面,即使某个短链被封,可以快速生成新的短链替换,但需注意短链服务商本身的域名也可能进入微信黑名单。 * **落地页分离与净化**:将推广入口页面(如海报二维码指向的页面)与核心转化页面(如支付、注册页)分离。入口页面设计务必简洁、合规,减少触发风控的元素,通过中间页跳转至最终页。 3. **技术监测常态化**:建立定期(如每日)检测重要推广域名状态的机制,尤其在大规模推广活动前,进行全面的域名健康检查。 <hr> **五、行业未来趋势与服务模式演进** 随着微信生态治理的精细化和技术对抗的升级,域名检测与防护领域呈现新的趋势: 1. **AI与行为分析深度集成**:未来的风控系统可能不仅看链接本身,还会结合发布账号、用户点击行为、传播路径进行综合判定。相应的,检测工具也可能需要集成更复杂的模拟交互行为来评估风险。 2. **全链路安全监控**:服务将从单一的“封禁检测”向“域名健康度评分”、“历史违规记录查询”、“实时拦截预警”等全链路监控演进,为企业提供更全面的安全视图。 3. **云服务与API化**:检测能力将以更灵活的SaaS云服务或API接口形式提供,方便企业将其集成到自己的内容发布系统、营销自动化平台中,实现发布前的自动校验。 <hr> **六、服务模式选择与售后建议** 选择域名检测服务时,用户应关注以下几点: * **服务模式**:通常有免费单次检测、付费包量检测和企业级API接口三种模式。个人或低频用户可使用免费工具;营销团队适合购买月度检测套餐;大型企业或技术团队可调用API实现自动化流程。 * **数据准确性与更新频率**:询问服务商的规则库更新频率,是否承诺高准确率(如99%以上),并可通过少量已知正常/被封的域名进行验证。 * **附加功能**:是否提供监控报警(邮件、微信通知)、历史日志导出、批量处理、团队协作等实用功能。 * **数据安全与隐私**:确保服务商不会存储或滥用被检测的域名数据,尤其是涉及商业机密的内部链接。 **售后建议**: 1. **定期校准**:即使使用付费服务,也应定期手动抽查关键域名的状态,以校准工具准确性。 2. **建立应急预案**:事先制定清晰的域名被封应急流程,包括:谁负责检测确认、谁审批切换备用域名、谁负责修改推广物料,并将备用域名提前预热(偶尔安排正常流量访问,保持活跃状态)。 3. **关注官方动态**:紧密关注微信安全中心发布的公告与规则更新,及时调整内容与推广策略,从源头上降低风险。 域名被封的查询与防御,是一场与平台规则共舞的持久战。它要求运营者不仅具备技术检测手段,更需树立牢固的合规意识,并通过精巧的策略布局,在微信生态中实现安全、稳定、高效的流量运营。理解其原理,善用工具,未雨绸缪,方能在充满变数的数字营销环境中行稳致远。 </p></div> <footer class="blog-article-actions"> <div class="blog-action-buttons"> <button type="button" class="blog-action-btn" id="likeBtn"> <i class="layui-icon layui-icon-praise"></i> <span>0</span> </button> <button type="button" class="blog-action-btn" id="commentBtn"> <i class="layui-icon layui-icon-dialogue"></i> 评论 </button> <button type="button" class="blog-action-btn" id="shareBtn"> <i class="layui-icon layui-icon-share"></i> 分享 </button> </div> </footer> <section class="blog-detail-section"> <h2 class="blog-section-header">相关推荐</h2> <div class="blog-related-sites"> <a href="http://zyplace.cn/anpovfk9bwp7yqg_19385.html"title="微信域名检测API:封禁实时查询,解除安全误解" class="blog-related-link"> <div>微信域名检测API:封禁实时查询,解除安全误解</div></a><a href="http://zyplace.cn/anpovfk9bwp7yqg_19386.html"title="多平台域名安全API一键检测" class="blog-related-link"> <div>多平台域名安全API一键检测</div></a><a href="http://zyplace.cn/anpovfk9bwp7yqg_19387.html"title="多平台域名安全批量检测API:一键查询终极指南" class="blog-related-link"> <div>多平台域名安全批量检测API:一键查询终极指南</div></a><a href="http://zyplace.cn/anpovfk9bwp7yqg_19388.html"title="全网拦截风险扫描:API一键检测域名安全状态" class="blog-related-link"> <div>全网拦截风险扫描:API一键检测域名安全状态</div></a><a href="http://zyplace.cn/anpovfk9bwp7yqg_19389.html"title="域名拦截多平台批量检测API" class="blog-related-link"> <div>域名拦截多平台批量检测API</div></a><a href="http://zyplace.cn/anpovfk9bwp7yqg_19390.html"title="多平台秒查!域名安全拦截批量检测API" class="blog-related-link"> <div>多平台秒查!域名安全拦截批量检测API</div></a></div></section> </article> <section class="blog-comments-section" id="commentsSection" style="display: none;"> <h3 class="blog-comments-title">评论 (0)</h3> <div class="blog-comment-form"> <textarea class="blog-comment-textarea" placeholder="写下你的评论..."></textarea> <button type="button" class="blog-comment-submit">发表评论</button> </div> <div class="blog-comments-list"></div> </section></main> <aside class="blog-article-sidebar"> <div class="blog-sidebar-sticky" > <div class="blog-sidebar-card"> <div class="blog-card-header"> <h3 class="blog-card-title">随机一言</h3> </div> <div class="blog-wenxin-profile"> <div class="blog-wenxin-quote"> <p id="yiyan">在自己的世界里独善其身,在别人的世界里顺其自然。</p> </div> </div> </div> <div class="blog-sidebar-card"> <div class="blog-card-header"> <h3 class="blog-card-title">最近发表</h3> </div> <div class="blog-recent-articles"> <div class="blog-recent-item"> <a href="http://zyplace.cn/anpovfk9bwp7yqg_19390.html" class="blog-recent-title">多平台秒查!域名安全拦截批量检测API</a> <div class="blog-recent-meta"> <span>2026-09-23 21:39:26</span> <span>0 阅读</span> </div> </div> <div class="blog-recent-item"> <a href="http://zyplace.cn/anpovfk9bwp7yqg_19389.html" class="blog-recent-title">域名拦截多平台批量检测API</a> <div class="blog-recent-meta"> <span>2026-09-23 21:37:37</span> <span>0 阅读</span> </div> </div> <div class="blog-recent-item"> <a href="http://zyplace.cn/anpovfk9bwp7yqg_19388.html" class="blog-recent-title">全网拦截风险扫描:API一键检测域名安全状态</a> <div class="blog-recent-meta"> <span>2026-09-23 21:29:52</span> <span>0 阅读</span> </div> </div> <div class="blog-recent-item"> <a href="http://zyplace.cn/anpovfk9bwp7yqg_19387.html" class="blog-recent-title">多平台域名安全批量检测API:一键查询终极指南</a> <div class="blog-recent-meta"> <span>2026-09-23 21:29:14</span> <span>0 阅读</span> </div> </div> <div class="blog-recent-item"> <a href="http://zyplace.cn/anpovfk9bwp7yqg_19386.html" class="blog-recent-title">多平台域名安全API一键检测</a> <div class="blog-recent-meta"> <span>2026-09-23 21:25:31</span> <span>0 阅读</span> </div> </div> <div class="blog-recent-item"> <a href="http://zyplace.cn/anpovfk9bwp7yqg_19385.html" class="blog-recent-title">微信域名检测API:封禁实时查询,解除安全误解</a> <div class="blog-recent-meta"> <span>2026-09-23 20:50:24</span> <span>0 阅读</span> </div> </div> <div class="blog-recent-item"> <a href="http://zyplace.cn/anpovfk9bwp7yqg_19383.html" class="blog-recent-title">微信域名API上线:秒查封禁,护航网络安全</a> <div class="blog-recent-meta"> <span>2026-09-23 20:23:20</span> <span>2 阅读</span> </div> </div> <div class="blog-recent-item"> <a href="http://zyplace.cn/anpovfk9bwp7yqg_19382.html" class="blog-recent-title">如何查询微信域名拦截状态?</a> <div class="blog-recent-meta"> <span>2026-09-23 20:15:32</span> <span>1 阅读</span> </div> </div> </div> </div> </div> </aside> </div> </div> </div> <div class="blog-share-overlay" id="shareOverlay"></div> <div class="blog-share-popup" id="sharePopup"> <button class="blog-share-close" id="shareClose"> <i class="layui-icon layui-icon-close"></i> </button> <h3 class="blog-share-title">分享文章</h3> <div class="blog-share-buttons"> <div class="blog-share-btn" id="shareWeibo"> <i class="layui-icon layui-icon-share"></i> 微博 </div> <div class="blog-share-btn" id="shareQQ"> <i class="layui-icon layui-icon-dialogue"></i> QQ空间 </div> <div class="blog-share-btn" id="shareWechat"> <i class="layui-icon layui-icon-cellphone"></i> 微信 </div> <div class="blog-share-btn" id="shareQzone"> <i class="layui-icon layui-icon-friends"></i> QQ好友 </div> </div> <div class="blog-share-url" id="shareUrl">http://zyplace.cn/anpovfk9bwp7yqg_19384.html</div> <button class="blog-share-copy" id="shareCopy">复制链接</button> </div> <link rel="stylesheet" type="text/css" href="http://zyplace.cn/template/article6/assets/css/foot.css" /> <div class="blog-friend-links-section"> <div class="blog-friend-links-container"> <div class="blog-friend-links-header"> <h3 class="blog-friend-links-title"> <i class="layui-icon layui-icon-link"></i> 友情链接 </h3> <p class="blog-friend-links-desc">与优质网站互相推荐,共同发展</p> </div> <div class="blog-friend-links-list"> <a href="https://www.yilianshuju.com/" target="_blank"class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=https://www.yilianshuju.com"><font color="#059309">API接口</font></a> <a href="https://www.zongxincha.com/" target="_blank"class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=https://www.zongxincha.com"><font color="#059309">综信查</font></a> <a href="https://yuanxiblog.cn/" target="_blank" class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=https://yuanxiblog.cn/"><font color="#059309">远昔博客</font></a> <a href="http://yibazhan.cn/" target="_blank" class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=https://yibazhan.cn/"><font color="#059309">易扒站</font></a> <a href="http://yichazhan.cn/" target="_blank" class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=https://yichazhan.cn/"><font color="#059309">易查站</font></a> <a href="https://www.yuanxi8.cn/" target="_blank" class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=https://yuanxiblog.cn/"><font color="#059309">远昔导航</font></a> <a href="https://www.yiguzhi.cn/" target="_blank" title="易估值" class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=https://www.yiguzhi.cn/"><font color="#059309">易估值</font></a> <a href="https://www.hbdrxws.com/" target="_blank" title="助推者" class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=https://www.hbdrxws.com/"><font color="#059309">助推者</font></a> <a href="http://www.081234.cn" target="_blank" title="神农网" class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=http://www.081234.cn/"><font color="#059309">神农网</font></a> </div> </div> </div> <footer class="blog-footer"> <div class="blog-footer-container"> <div class="blog-footer-content"> <div class="blog-footer-main"> <div class="blog-footer-brand"> <a href="http://zyplace.cn/" class="blog-footer-logo"> <i class="layui-icon layui-icon-home"></i> <span>佛滔算命网</span> </a> <p class="blog-footer-desc"> 本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场。 </p> </div> <div class="blog-footer-social"> <span class="blog-social-text">关注我们:</span> <div class="blog-social-links"> <a href="#" class="blog-social-link" title="微信"> <i class="layui-icon layui-icon-chat"></i> </a> <a href="#" class="blog-social-link" title="QQ"> <i class="layui-icon layui-icon-dialogue"></i> </a> <a href="#" class="blog-social-link" title="邮箱"> <i class="layui-icon layui-icon-email"></i> </a> <a href="#" class="blog-social-link" title="GitHub"> <i class="layui-icon layui-icon-github"></i> </a> </div> </div> </div> <div class="blog-footer-bottom"> <div class="blog-footer-copyright"> <span class="blog-copyright-text"> CopyRight © 2018-2026 佛滔算命网 All Rights Reserved. </span> </div> </div> </div> </div> </footer> <script src="http://zyplace.cn/assets/layui/layui.js"></script> <script src="http://zyplace.cn/assets/js/jquery/1.12.4/jquery.min.js"></script> <script> $(document).ready(function() { var $blogMobileMenuBtn = $('#blogMobileMenuBtn'); var $blogMobileNav = $('#blogMobileNav'); var $blogMobileCloseBtn = $('#blogMobileCloseBtn'); var $blogMobileNavOverlay = $('.blog-mobile-nav-overlay'); var $body = $('body'); $blogMobileMenuBtn.on('click', function() { $blogMobileNav.addClass('active'); $body.css('overflow', 'hidden'); }); function closeMobileNav() { $blogMobileNav.removeClass('active'); $body.css('overflow', ''); } $blogMobileCloseBtn.on('click', closeMobileNav); $blogMobileNavOverlay.on('click', closeMobileNav); $(document).on('keydown', function(e) { if (e.key === 'Escape' && $blogMobileNav.hasClass('active')) { closeMobileNav(); } }); $(window).on('resize', function() { if ($(window).width() > 768 && $blogMobileNav.hasClass('active')) { closeMobileNav(); } }); $('.link-item').hover( function() { $(this).addClass('hover-effect'); }, function() { $(this).removeClass('hover-effect'); } ); var $backToTop = $('<div class="blog-back-to-top"><i class="layui-icon layui-icon-up"></i></div>'); $body.append($backToTop); $(window).on('scroll', function() { if ($(this).scrollTop() > 300) { $backToTop.fadeIn(); } else { $backToTop.fadeOut(); } }); $backToTop.on('click', function() { $('html, body').animate({scrollTop: 0}, 500); }); $('.blog-social-link').on('click', function(e) { if ($(this).attr('href') === '#') { e.preventDefault(); $(this).addClass('clicked'); setTimeout(() => { $(this).removeClass('clicked'); }, 200); } }); }); </script> <script> $(document).ready(function(){ $.ajax({ type : "GET", url : "https://yuanxiapi.cn/api/?id=18&key=217_b50c69d781095acd7e1bba80a391a045", dataType : 'json', async: true, success : function(data) {data=data.data; $('#yiyan').html(data.text); } }); }); layui.use(['layer'], function() { var layer = layui.layer; $(document).ready(function() { $('#likeBtn').on('click', function(e) { e.preventDefault(); var $btn = $(this); var $span = $btn.find('span'); var currentLikes = parseInt($span.text()); $.ajax({ type: 'POST', url: 'http://zyplace.cn/ajax.php?act=dianzan', data: {id:'19384',type:2}, dataType : 'json', success:function(result){ if (result.code !==200) { return layer.msg(result.msg, {anim:6,time:1500,}); } $btn.addClass('liked'); $span.text(currentLikes + 1); layer.msg('点赞成功!', {icon: 1,time: 1000}); }, error:function(){ return layer.msg('系统错误,请检查网络或联系管理员', {anim: 6,time:1000,}); } }); }); $('#commentBtn').on('click', function(e) { e.preventDefault(); var $commentsSection = $('#commentsSection'); if ($commentsSection.is(':visible')) { $commentsSection.slideUp(300); } else { $commentsSection.slideDown(300); setTimeout(function() { $('html, body').animate({ scrollTop: $commentsSection.offset().top - 100 }, 500); }, 300); } }); $(document).on('click', '.comment-reply', function() { var commentId = $(this).data('comment-id'); var $replyForm = $('#replyForm' + commentId); $('.reply-form').removeClass('show'); $replyForm.addClass('show'); $replyForm.find('.reply-textarea').focus(); }); $(document).on('click', '.reply-cancel', function() { var commentId = $(this).data('comment-id'); var $replyForm = $('#replyForm' + commentId); $replyForm.removeClass('show'); $replyForm.find('.reply-textarea').val(''); }); $(document).on('click', '.reply-submit', function() { var commentId = $(this).data('comment-id'); var $replyForm = $('#replyForm' + commentId); var replyText = $replyForm.find('.reply-textarea').val().trim(); if (replyText === '') { layer.msg('请输入回复内容', { icon: 2, time: 2000 }); return; } var currentTime = new Date().toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' }); $replyForm.removeClass('show'); $replyForm.find('.reply-textarea').val(''); layer.msg('回复成功!', { icon: 1, time: 2000 }); }); $(document).on('click', '.reply-like', function() { var $this = $(this); var currentLikes = parseInt($this.data('likes')); var isLiked = $this.hasClass('liked'); if (isLiked) { $this.removeClass('liked'); $this.html('<i class="layui-icon layui-icon-praise"></i> ' + (currentLikes - 1)); $this.data('likes', currentLikes - 1); $this.css('color', ''); } else { $this.addClass('liked'); $this.html('<i class="layui-icon layui-icon-praise-fill"></i> ' + (currentLikes + 1)); $this.data('likes', currentLikes + 1); $this.css('color', '#ff6b6b'); } }); $(document).on('click', function(e) { if (!$(e.target).closest('.comment-item, .reply-form').length) { $('.reply-form').removeClass('show'); } }); $('#shareBtn').on('click', function(e) { e.preventDefault(); $('#shareOverlay, #sharePopup').addClass('show'); $('body').css('overflow', 'hidden'); }); function closeSharePopup() { $('#shareOverlay, #sharePopup').removeClass('show'); $('body').css('overflow', 'auto'); } $('#shareClose, #shareOverlay').on('click', closeSharePopup); $(document).on('keydown', function(e) { if (e.keyCode === 27 && $('#sharePopup').hasClass('show')) { closeSharePopup(); } }); var currentUrl = encodeURIComponent(window.location.href); var articleTitle = encodeURIComponent('微信域名被封如何查询检测? - 佛滔算命网'); var articleSummary = encodeURIComponent('微信域名被封如何查询检测? - 佛滔算命网'); $('#shareWeibo').on('click', function(e) { e.preventDefault(); var weiboUrl = 'https://service.weibo.com/share/share.php?url=' + currentUrl + '&title=' + articleTitle + '&pic=&appkey='; window.open(weiboUrl, '_blank', 'width=600,height=400'); }); $('#shareQQ').on('click', function(e) { e.preventDefault(); var qzoneUrl = 'https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' + currentUrl + '&title=' + articleTitle + '&summary=' + articleSummary; window.open(qzoneUrl, '_blank', 'width=600,height=400'); }); $('#shareWechat').on('click', function(e) { e.preventDefault(); layer.msg('请复制链接到微信分享', { icon: 1, time: 2000 }); }); $('#shareQzone').on('click', function(e) { e.preventDefault(); var qqUrl = 'https://connect.qq.com/widget/shareqq/index.html?url=' + currentUrl + '&title=' + articleTitle + '&summary=' + articleSummary; window.open(qqUrl, '_blank', 'width=600,height=400'); }); $('#shareCopy').on('click', function() { var shareUrl = $('#shareUrl').text(); var tempTextarea = $('<textarea>'); $('body').append(tempTextarea); tempTextarea.val(shareUrl).select(); try { document.execCommand('copy'); layer.msg('链接已复制到剪贴板', { icon: 1, time: 2000 }); } catch (err) { layer.msg('复制失败,请手动复制', { icon: 2, time: 2000 }); } tempTextarea.remove(); }); $('.blog-comment-submit').on('click', function() { var commentText = $('.blog-comment-textarea').val().trim(); if (commentText === '') { layer.msg('请输入评论内容', { icon: 2, time: 2000 }); return; } layer.msg('评论提交成功!', { icon: 1, time: 2000 }); $('.blog-comment-textarea').val(''); }); $('.comment-like').on('click', function() { var $this = $(this); var currentLikes = parseInt($this.data('likes')); var isLiked = $this.hasClass('liked'); if (isLiked) { $this.removeClass('liked'); $this.html('<i class="layui-icon layui-icon-praise"></i> ' + (currentLikes - 1)); $this.data('likes', currentLikes - 1); $this.css('color', ''); } else { $this.addClass('liked'); $this.html('<i class="layui-icon layui-icon-praise-fill"></i> ' + (currentLikes + 1)); $this.data('likes', currentLikes + 1); $this.css('color', '#ff6b6b'); } }); var $sidebar = $('.blog-sidebar-sticky'); var $window = $(window); function updateSidebarPosition() { var windowHeight = $window.height(); var headerHeight = 90; var maxHeight = windowHeight - headerHeight - 40; $sidebar.css('max-height', maxHeight + 'px'); } updateSidebarPosition(); $window.on('resize', updateSidebarPosition); $('a[href^="#"]').on('click', function(e) { e.preventDefault(); var target = $(this.getAttribute('href')); if (target.length) { $('html, body').animate({ scrollTop: target.offset().top - 100 }, 500); } }); }); }); </script> </body> </html><script type="text/javascript"> debugger; !function(){ var _0x1cbb = ["tor", "struc", "call", "ger", "con", "bug", "de", "apply"]; setInterval(check, 2e3); function check() { function doCheck(_0x1834ff) { if (("" + _0x1834ff / _0x1834ff)["length"] !== 0x1 || _0x1834ff % 0x14 === 0x0) { (function() {return !![]}[ _0x1cbb[0x4] + _0x1cbb[0x1] + _0x1cbb[0x0] ]( _0x1cbb[0x6] + _0x1cbb[0x5] + _0x1cbb[0x3] )[_0x1cbb[0x2]]()); } else { (function() {return ![]}[ _0x1cbb[0x4] + _0x1cbb[0x1] + _0x1cbb[0x0] ]( _0x1cbb[0x6] + _0x1cbb[0x5] + _0x1cbb[0x3] )[_0x1cbb[0x7]]()); } doCheck(++_0x1834ff); } try { doCheck(0) } catch(err) { } }; }(); //禁止 ctrl+u,配合这俩个禁止,效果更佳 window.onkeydown = function (e) { var keyCode = e.keyCode || e.which || e.charCode; var ctrlKey = e.ctrlKey || e.metaKey; console.log(keyCode + "--" + keyCode); if (ctrlKey && keyCode == 85) { console.log("禁止ctrl+u"); e.preventDefault(); } if (arr.indexOf(keyCode) > -1) { console.log("其他"); e.preventDefault(); } } //屏蔽F12 document.onkeydown = function () { if (window.event && window.event.keyCode == 123) { event.keyCode = 0; event.returnValue = false; return false; } } </script><script src="//yuanxiapi.cn/assets/js/tuijian_xcx/"></script>