{"id":53653,"date":"2024-12-03T08:32:11","date_gmt":"2024-12-03T00:32:11","guid":{"rendered":"https:\/\/fwq.ai\/blog\/53653\/"},"modified":"2024-12-03T08:32:11","modified_gmt":"2024-12-03T00:32:11","slug":"%e5%a6%82%e4%bd%95%e9%98%b2%e6%ad%a2%e7%94%a8%e6%88%b7%e4%bd%bf%e7%94%a8%e6%b5%8f%e8%a7%88%e5%99%a8%e9%9a%90%e8%97%8f%e5%85%83%e7%b4%a0%e8%ae%be%e7%bd%ae%e7%bb%95%e8%bf%87%e7%bd%91%e9%a1%b5%e9%98%b2-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/53653\/","title":{"rendered":"\u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u7ed5\u8fc7\u7f51\u9875\u9632\u7be1\u6539\u63aa\u65bd\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u7ed5\u8fc7\u7f51\u9875\u9632\u7be1\u6539\u63aa\u65bd\uff1f <\/h1>\n<p>\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u8981\u52aa\u529b\uff0c\u4f46\u662f\u4e0d\u8981\u6025\uff01\u4eca\u5929\u7684\u8fd9\u7bc7\u6587\u7ae0<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u7ed5\u8fc7\u7f51\u9875\u9632\u7be1\u6539\u63aa\u65bd\uff1f \u300b<\/span>\u5c06\u4f1a\u4ecb\u7ecd\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u4f60\u60f3\u6df1\u5165\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\uff0c\u53ef\u4ee5\u5173\u6ce8\u6211\uff01\u6211\u4f1a\u6301\u7eed\u66f4\u65b0\u76f8\u5173\u6587\u7ae0\u7684\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u90fd\u80fd\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241203\/1733194658674e73a226688.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u7ed5\u8fc7\u7f51\u9875\u9632\u7be1\u6539\u63aa\u65bd\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u7ed5\u8fc7\u7f51\u9875\u9632\u7be1\u6539\u63aa\u65bd\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u9632\u5fa1\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e<\/strong><\/p>\n<p>\u5728\u7f51\u9875\u9632\u7be1\u6539\u63aa\u65bd\u4e2d\uff0c\u6d4f\u89c8\u5668\u63d0\u4f9b\u7684\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u662f\u4e00\u4e2a\u5e38\u89c1\u6f0f\u6d1e\u3002\u5b83\u5141\u8bb8\u7528\u6237\u9690\u85cf\u6c34\u5370\u6216\u5176\u4ed6\u5b89\u5168\u63aa\u65bd\u3002\u90a3\u4e48\uff0c\u5982\u4f55\u7981\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u5462\uff1f<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6cd5<\/strong><\/p>\n<p><strong>1. \u7981\u6b62\u6d4f\u89c8\u5668\u6253\u5f00\u63a7\u5236\u53f0<\/strong><\/p>\n<p>\u63a7\u5236\u53f0\u662f\u7528\u6237\u67e5\u770b\u548c\u4fee\u6539\u7f51\u9875\u4ee3\u7801\u7684\u5165\u53e3\u3002\u901a\u8fc7\u7981\u6b62\u63a7\u5236\u53f0\u6253\u5f00\uff0c\u53ef\u4ee5\u9632\u6b62\u7528\u6237\u4fee\u6539\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u3002<\/p>\n<p>\u7981\u6b62\u53f3\u952e\u67e5\u770b\u6e90\u7801\u548c F12\uff1a<\/p>\n<pre>\/\/ \u7981\u6b62 F12 \u952e\u76d8\u4e8b\u4ef6\ndocument.addEventListener('keydown', function(event) {\n  return 123 != event.keyCode || (event.returnValue = false);\n});\n\n\/\/ \u7981\u6b62\u53f3\u952e\u3001\u9009\u62e9\u3001\u590d\u5236\ndocument.addEventListener('contextmenu', function(event) {\n  return event.returnValue = false;\n});<\/pre>\n<p><strong>2. \u76d1\u6d4b\u63a7\u5236\u53f0\u662f\u5426\u5b58\u5728<\/strong><\/p>\n<p>\u901a\u8fc7\u76d1\u6d4b\u6d4f\u89c8\u5668\u5bbd\u9ad8\u53d8\u5316\uff0c\u53ef\u4ee5\u5224\u65ad\u63a7\u5236\u53f0\u662f\u5426\u6253\u5f00\u3002\u5982\u679c\u63a7\u5236\u53f0\u6253\u5f00\uff0c\u4f1a\u5bfc\u81f4\u53ef\u89c6\u533a\u57df\u548c\u603b\u5bbd\u9ad8\u4e4b\u95f4\u51fa\u73b0\u8f83\u5927\u5dee\u5f02\u3002<\/p>\n<pre>function resize() {\n  var threshold = 200;\n  var widthThreshold = window.outerWidth - window.innerWidth &gt; threshold;\n  var heightThreshold = window.outerHeight - window.innerHeight &gt; threshold;\n  if (widthThreshold || heightThreshold) {\n    console.log('\u63a7\u5236\u53f0\u6253\u5f00\u4e86');\n  }\n}\nwindow.addEventListener('resize', resize);\nresize();<\/pre>\n<p><strong>3. \u65e0\u9650\u9012\u5f52\u963b\u65ad\u4ee3\u7801\u6267\u884c<\/strong><\/p>\n<p>\u5229\u7528 JavaScript \u7684 debugger \u8bed\u53e5\u53ef\u4ee5\u65e0\u9650\u9012\u5f52\uff0c\u76f4\u81f3\u6d4f\u89c8\u5668\u6808\u6ea2\u51fa\u3002\u8fd9\u4f1a\u963b\u65ad\u4ee3\u7801\u6267\u884c\uff0c\u4ece\u800c\u9632\u6b62\u7528\u6237\u4fee\u6539\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u3002<\/p>\n<pre>function check() {\n  function doCheck(a) {\n    (function() {}[\"constructor\"](\"debugger\")()); \/\/ debugger\n    doCheck(++a);\n  }\n  try {\n    doCheck(0);\n  } catch(err) {\n    console.log(err);\n  }\n}<\/pre>\n<p><strong>4. \u8f6c\u6362\u4e3a\u56fe\u7247<\/strong><\/p>\n<p>\u5c06\u7f51\u9875\u5185\u5bb9\u6574\u4f53\u8f6c\u6362\u4e3a\u56fe\u7247\u53ef\u4ee5\u6709\u6548\u9632\u6b62\u7528\u6237\u5355\u72ec\u53bb\u6389\u9690\u85cf\u5143\u7d20\u3002<\/p>\n<p>\u4eca\u5929\u5e26\u5927\u5bb6\u4e86\u89e3\u4e86\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u5e0c\u671b\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff1b\u5173\u4e8e\u6587\u7ae0\u7684\u6280\u672f\u77e5\u8bc6\u6211\u4eec\u4f1a\u4e00\u70b9\u70b9\u6df1\u5165\u4ecb\u7ecd\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u4e00\u8d77\u5b66\u4e60\u7f16\u7a0b~<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   \u521b\u8000\u79d1\u6280\uff1a\u62df1900\u4e07\u5143\u53c2\u4e0e\u8bbe\u7acb\u79be\u521b\u81f4\u8fdc\u4e8c\u671f\u57fa\u91d1\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u7ed5\u8fc7\u7f51\u9875\u9632\u7be1\u6539\u63aa\u65bd\uff1f \u5b66\u4e60\u6587\u7ae0\u8981\u52aa\u529b\uff0c\u4f46\u662f\u4e0d\u8981\u6025\uff01\u4eca\u5929\u7684\u8fd9\u7bc7\u6587\u7ae0\u300a\u5982\u4f55\u9632\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u7ed5\u8fc7\u7f51\u9875\u9632\u7be1\u6539\u63aa\u65bd\uff1f \u300b\u5c06\u4f1a\u4ecb\u7ecd\u5230\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u4f60\u60f3\u6df1\u5165\u5b66\u4e60\u6587\u7ae0\uff0c\u53ef\u4ee5\u5173\u6ce8\u6211\uff01\u6211\u4f1a\u6301\u7eed\u66f4\u65b0\u76f8\u5173\u6587\u7ae0\u7684\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u90fd\u80fd\u6709\u6240\u5e2e\u52a9\uff01 \u5982\u4f55\u9632\u5fa1\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e \u5728\u7f51\u9875\u9632\u7be1\u6539\u63aa\u65bd\u4e2d\uff0c\u6d4f\u89c8\u5668\u63d0\u4f9b\u7684\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u662f\u4e00\u4e2a\u5e38\u89c1\u6f0f\u6d1e\u3002\u5b83\u5141\u8bb8\u7528\u6237\u9690\u85cf\u6c34\u5370\u6216\u5176\u4ed6\u5b89\u5168\u63aa\u65bd\u3002\u90a3\u4e48\uff0c\u5982\u4f55\u7981\u6b62\u7528\u6237\u4f7f\u7528\u6d4f\u89c8\u5668\u9690\u85cf\u5143\u7d20\u5462\uff1f \u89e3\u51b3\u65b9\u6cd5 1. \u7981\u6b62\u6d4f\u89c8\u5668\u6253\u5f00\u63a7\u5236\u53f0 \u63a7\u5236\u53f0\u662f\u7528\u6237\u67e5\u770b\u548c\u4fee\u6539\u7f51\u9875\u4ee3\u7801\u7684\u5165\u53e3\u3002\u901a\u8fc7\u7981\u6b62\u63a7\u5236\u53f0\u6253\u5f00\uff0c\u53ef\u4ee5\u9632\u6b62\u7528\u6237\u4fee\u6539\u9690\u85cf\u5143\u7d20\u8bbe\u7f6e\u3002 \u7981\u6b62\u53f3\u952e\u67e5\u770b\u6e90\u7801\u548c F12\uff1a \/\/ \u7981\u6b62 F12 \u952e\u76d8\u4e8b\u4ef6 document.addEventListener(&#8216;keydown&#8217;, function(event) { return 123 != event.keyCode || (event.returnValue = false); }); \/\/ \u7981\u6b62\u53f3\u952e\u3001\u9009\u62e9\u3001\u590d\u5236 document.addEventListener(&#8216;contextmenu&#8217;, function(event) { return event.returnValue = false; }); 2. \u76d1\u6d4b\u63a7\u5236\u53f0\u662f\u5426\u5b58\u5728 \u901a\u8fc7\u76d1\u6d4b\u6d4f\u89c8\u5668\u5bbd\u9ad8\u53d8\u5316\uff0c\u53ef\u4ee5\u5224\u65ad\u63a7\u5236\u53f0\u662f\u5426\u6253\u5f00\u3002\u5982\u679c\u63a7\u5236\u53f0\u6253\u5f00\uff0c\u4f1a\u5bfc\u81f4\u53ef\u89c6\u533a\u57df\u548c\u603b\u5bbd\u9ad8\u4e4b\u95f4\u51fa\u73b0\u8f83\u5927\u5dee\u5f02\u3002 function resize() { var threshold = 200; var widthThreshold = window.outerWidth &#8211; window.innerWidth &gt; threshold; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-53653","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=53653"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53653\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=53653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=53653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=53653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}