{"id":3085,"date":"2018-09-18T12:57:09","date_gmt":"2018-09-18T04:57:09","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=3085"},"modified":"2018-09-18T12:57:09","modified_gmt":"2018-09-18T04:57:09","slug":"%e7%bd%91%e7%ab%99%e6%8e%a5%e5%85%a5-vaptcha-%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=3085","title":{"rendered":"\u7f51\u7ad9\u63a5\u5165 vaptcha \u6559\u7a0b"},"content":{"rendered":"<p>\n\t\u81ea\u4ece\u7f51\u7edc\u8bde\u751f\u4ee5\u6765\uff0c\u6211\u4eec\u9700\u8981\u767b\u5f55\u7684\u7f51\u5740\u57fa\u672c\u4e0a\u90fd\u9700\u8981\u9a8c\u8bc1\u7801\u8fdb\u884c\u9a8c\u8bc1\uff0c\u7528\u6765\u9632\u6b62\u4e00\u4e9b\u653b\u51fb\u65e0\u9650\u767b\u5f55\u548c\u6ce8\u518c\u884c\u4e3a\u3002\u4ee5\u5f80\u7684\u9a8c\u8bc1\u7801\u9a8c\u8bc1\u4f53\u9a8c\u975e\u5e38\u7684\u4e0d\u597d\uff0c\u800c\u4e14\u5bb9\u6613\u7834\u89e3\u3002\u968f\u7740\u8fd1\u51e0\u5e74\u7684\u53d1\u5c55\uff0c\u7c7b\u4f3c 12306 \u8fd9\u6837\u7684\u7f51\u7ad9\u4e0a\u7684\u4e8c\u7ef4\u7801\u7ecf\u5e38\u88ab\u5410\u69fd\u3002\u968f\u7740\u963f\u91cc\u7684\u6ed1\u52a8\u9a8c\u8bc1\u7801\u7684\u63a8\u51fa\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u7f51\u7ad9\u91c7\u7528\u8fd9\u79cd\u65b9\u5f0f\uff0c\u540e\u6765\u5404\u79cd\u63a8\u62fd\u9a8c\u8bc1\u7801\u4e5f\u5982\u96e8\u540e\u6625\u7b0b\u822c\u7684\u5192\u4e86\u51fa\u6765\u3002\u8fd9\u4e9b\u9a8c\u8bc1\u7801\u7684\u4f7f\u7528\u90fd\u6bd4\u8f83\u590d\u6742\uff0c\u800c\u4e14\u5c40\u9650\u6027\u6bd4\u8f83\u591a\uff0c\u6700\u8fd1\u6211\u53d1\u73b0\u4e86 vaptcha \u9a8c\u8bc1\u7801\u975e\u5e38\u7684\u4e0d\u9519\uff0c\u4e8e\u662f\u4fbf\u901a\u8fc7\u672c\u6587\u63a8\u8350\u7ed9\u5927\u5bb6\uff01\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"vaptcha\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/vaptcha-demo.png\" style=\"width: 584px;height: 597px\" \/>\n<\/p>\n<p>\n\tVAPTCHA\u662f&ldquo;Variation Analysis based Public Turing Test to Tell Computers and Humans Apart&rdquo;\uff08\u57fa\u4e8e\u53d8\u91cf\u5206\u6790\u6cd5\u6765\u533a\u5206\u4eba\u7c7b\u548c\u8ba1\u7b97\u673a\u7684\u56fe\u7075\u6d4b\u8bd5\u7a0b\u5e8f\uff09\uff0c\u53c8\u79f0\u4e3a\u624b\u52bf\u9a8c\u8bc1\uff0c\u662f\u9a8c\u8bc1\u7801\u7684\u4e00\u79cd\u3002\u5ba3\u4f20\u4e2d\u4ecb\u7ecd\u7684\u662f\u57fa\u4e8e\u4eba\u5de5\u667a\u80fd\u548c\u5927\u6570\u636e\u7684\u65b0\u4e00\u4ee3\u4eba\u673a\u9a8c\u8bc1\u89e3\u51b3\u65b9\u6848\uff0c\u6211\u89c9\u5f97\u8fd9\u4e2a\u5b9e\u9645\u53ef\u80fd\u5e76\u4e0d\u5b58\u5728\uff0c\u539f\u56e0\u662f\u76ee\u524d\u4f7f\u7528\u7684\u4eba\u5e76\u4e0d\u591a\uff0c\u5927\u6570\u636e\u4ece\u54ea\u91cc\u6765\uff1f\u4eba\u5de5\u667a\u80fd\u8fd8\u5728\u6982\u5ff5\u9636\u6bb5\uff0c\u6781\u5c11\u6709\u6210\u529f\u7684\u5e94\u7528\uff0c\u6211\u53ea\u80fd\u8bf4\u5979\u73b0\u5728\u53ef\u80fd\u662f\u4f2a\u667a\u80fd\u3002\u4f46\u662f\u6211\u76f8\u4fe1\u968f\u7740\u65f6\u95f4\u7684\u63a8\u79fb\uff0c\u8fd9\u5bb6\u516c\u53f8\u7684\u9a8c\u8bc1\u7801\u4f1a\u88ab\u8d8a\u6765\u8d8a\u591a\u7684\u4eba\u91c7\u7528\uff0c\u4e8e\u662f\u5c31\u5199\u4e86\u8fd9\u7bc7\u6587\u7ae0\u5206\u4eab\u7ed9\u5927\u5bb6\uff01\n<\/p>\n<p>\n\t\u9996\u5148\uff0c\u4f7f\u7528 VAPTCHA \u5fc5\u987b\u8981\u518d\u5979\u7684\u5b98\u7f51\u4e0a\u8fdb\u884c\u6ce8\u518c\u4e00\u4e2a\u8d26\u53f7\uff0c\u4f01\u4e1a\u548c\u4e2a\u4eba\u76ee\u524d\u90fd\u88ab\u652f\u6301\u6ce8\u518c\u3002<a href=\"https:\/\/www.vaptcha.com\/\" name=\"vaptcha\" target=\"_blank\" title=\"vaptcha\">https:\/\/www.vaptcha.com\/<\/a>\n<\/p>\n<p>\n\t\u6ce8\u518c\u540e\uff0c\u9700\u8981\u7ed1\u5b9a\u90ae\u7bb1\u624d\u53ef\u4ee5\u64cd\u4f5c\uff0c\u6240\u4ee5\u5927\u5bb6\u8981\u51c6\u5907\u597d\u4e00\u4e2a\u90ae\u7bb1\u3002\n<\/p>\n<p>\n\t\u90ae\u7bb1\u7ed1\u5b9a\u597d\u4e4b\u540e\uff0c\u5c31\u53ef\u4ee5\u5f00\u59cb\u63a5\u5165 vaptcha \u4e86\u3002\n<\/p>\n<p>\n\t\u518d\u5f00\u59cb\u4e4b\u524d\uff0c\u9700\u8981\u518d vaptcha \u7684\u540e\u53f0\uff0c\u521b\u5efa\u4e00\u4e2a\u9a8c\u8bc1\u5355\u5143\uff0c\u4e2a\u4eba\u7528\u6237\u76ee\u524d\u53ea\u652f\u6301\u521b\u5efa 3 \u4e2a\u9a8c\u8bc1\u5355\u5143\u3002\u9a8c\u8bc1\u5355\u5143\u9700\u8981\u7ed1\u5b9a\u57df\u540d\uff0c\u5982\u679c\u4f60\u6ca1\u6709\u57df\u540d\uff0c\u5efa\u8bae\u4f7f\u7528 github \u4e0a\u521b\u5efa\u4e2a\u4eba\u7f51\u7ad9\uff0c\u7528 github.com \u8fd9\u4e2a\u57df\u540d\u5373\u53ef\u3002\n<\/p>\n<p>\n\t\u521b\u5efa\u9a8c\u8bc1\u5355\u5143\u540e\uff0c\u8bf7\u8bb0\u4f4f\u4f60\u7684 VID \u548c KEY\uff0c\u540e\u9762\u4f1a\u7528\u5230\u3002\n<\/p>\n<p>\n\t\u4f7f\u7528 vaptcha \u975e\u5e38\u7684\u7b80\u5355\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"vaptcha\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/vaptcha-test.png\" style=\"width: 381px;height: 258px\" \/>\n<\/p>\n<p>\n\t\u7b2c\u4e00\u6b65\uff0c\u5f15\u5165 vaptcha \u63d0\u4f9b\u7684 js \u811a\u672c\u6587\u4ef6\u3002\n<\/p>\n<pre class=\"brush:xml;\">\r\n&lt;script src=&quot;https:\/\/cdn.vaptcha.com\/v2.js&quot;&gt;&lt;\/script&gt;<\/pre>\n<p>\n\t\u7b2c\u4e8c\u6b65\uff0c\u5728\u9700\u8981\u663e\u793a\u9a8c\u8bc1\u7801\u7684\u5730\u65b9\uff0c\u52a0\u5165\u4e0b\u9762\u7684\u4ee3\u7801\uff1a\n<\/p>\n<pre class=\"brush:xml;\">\r\n&lt;div data-vid=&quot;\u4f60\u7684vid&quot; style=&quot;width: 300px;height: 36px;&quot;&gt;\r\n&nbsp; &nbsp; &lt;div class=&quot;vaptcha-init-main&quot;&gt;\r\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;vaptcha-init-loading&quot;&gt;\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a href=&quot;\/&quot; target=&quot;_blank&quot;&gt;\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;img src=&quot;https:\/\/cdn.vaptcha.com\/vaptcha-loading.gif&quot; \/&gt;\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/a&gt;\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;span class=&quot;vaptcha-text&quot;&gt;Vaptcha\u542f\u52a8\u4e2d...&lt;\/span&gt;\r\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;\/div&gt;\r\n&nbsp; &nbsp; &lt;\/div&gt;\r\n&lt;\/div&gt;<\/pre>\n<p>\n\tvaptcha \u4f1a\u751f\u6210 vaptcha_token \u53c2\u6570\uff0c\u5728\u4f60\u63d0\u4ea4\u8868\u5355\u7684\u65f6\u5019\uff0c\u63d0\u4ea4\u7ed9\u4f60\u7684\u540e\u53f0\u3002\u7c7b\u4f3c\u5982\u4e0b\uff1a\n<\/p>\n<pre class=\"brush:jscript;\">\r\nwindow.vaptcha({\r\n&nbsp; type: &#039;invisible&#039;\r\n&nbsp; \/\/\u5176\u4ed6\u914d\u7f6e\u53c2\u6570\u5ffd\u7565\r\n}).then(function(vaptchaObj){\r\n&nbsp; obj = vaptchaObj;\/\/\u5c06VAPTCHA\u9a8c\u8bc1\u5b9e\u4f8b\u4fdd\u5b58\u5230\u5c40\u90e8\u53d8\u91cf\u4e2d\r\n&nbsp; \/\/ \u9a8c\u8bc1\u7801\u52a0\u8f7d\u5b8c\u6210\u540e\u5c06\u4e8b\u4ef6\u7ed1\u5b9a\u5230\u6309\u94ae\r\n&nbsp; \/\/ \u8c03\u7528validate()\u65b9\u6cd5\u7684\u4f2a\u4ee3\u7801\uff0c\u5c06\u8be5\u65b9\u6cd5\u7684\u8c03\u7528\u7ed1\u5b9a\u5728&#039;click&#039;\u4e8b\u4ef6\u4e0a\uff0c\u5b9e\u9645\u5f00\u53d1\u4e2d\u9700\u8981\u66f4\u6539\u4e3a\u5408\u9002\u7684\u8c03\u7528\u65b9\u5f0f\r\n&nbsp; vaptchaObj.listen(&#039;success&#039;, function() {\r\n&nbsp; &nbsp; &nbsp;data = {\r\n&nbsp; &nbsp; &nbsp; \/\/\u8868\u5355\u6570\u636e\r\n&nbsp; &nbsp; &nbsp; token: vaptchaObj.getToken()\r\n&nbsp; &nbsp; }\r\n&nbsp; &nbsp; $.post(&#039;\/login&#039;)\r\n&nbsp; })\r\n&nbsp; $(&#039;#login-button&#039;).on(&#039;click&#039;,function(){\r\n&nbsp; &nbsp; \/\/\u6267\u884c\u9a8c\u8bc1\u524d\u9700\u8981\u5148\u5224\u65ad\u9a8c\u8bc1\u5b9e\u4f8b\u662f\u5426\u52a0\u8f7d\u5b8c\u6210\r\n&nbsp; &nbsp; vaptchaObj.validate();\r\n&nbsp; })\r\n&nbsp; $(&#039;#reset&#039;).on(&#039;click&#039;,function(){\r\n&nbsp; &nbsp; \/\/\u6267\u884c\u9a8c\u8bc1\u524d\u9700\u8981\u5148\u5224\u65ad\u9a8c\u8bc1\u5b9e\u4f8b\u662f\u5426\u52a0\u8f7d\u5b8c\u6210\r\n&nbsp; &nbsp; vaptchaObj.reset();\r\n&nbsp; })\r\n})<\/pre>\n<p>\n\ttoken \u63d0\u4ea4\u5230\u540e\u53f0\u540e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 RestTemplate \u5c06 token \u7b49\u53c2\u6570\u63d0\u4ea4\u5230 http:\/\/api.vaptcha.com\/v2\/validate \u8fdb\u884c\u4eba\u673a\u9a8c\u8bc1\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"vaptcha\" src=\"https:\/\/github.com\/xmt1139057136\/xttblog\/blob\/master\/vaptcha.png?raw=true\" style=\"width: 472px;height: 447px\" \/>\n<\/p>\n<p>\n\t\u5bf9 vaptcha \u611f\u5174\u8da3\u7684\u53ef\u4ee5\u5bf9\u524d\u7aef\u7684\u6e90\u7801\u8fdb\u884c\u5206\u6790\uff0c\u5b83\u4f7f\u7528 canvas \u8fdb\u884c\u7ed8\u56fe\uff0c\u548c\u6211\u7684\u4e00\u4e9b<a href=\"https:\/\/www.xttblog.com\/?s=\u9a8c\u8bc1\u7801\" name=\"\u9a8c\u8bc1\u7801\" target=\"_blank\" title=\"\u9a8c\u8bc1\u7801\">\u9a8c\u8bc1\u7801<\/a>\u6587\u7ae0\u91cc\u63d0\u5230\u7684\u539f\u7406\u7c7b\u4f3c\u3002demo \u6f14\u793a\u8bf7\u70b9\u51fb<a href=\"https:\/\/www.xttblog.com\/vaptcha.html\">\u8fd9\u91cc<\/a>\u3002\n<\/p>\n<h2>\n\t\u53c2\u8003\u8d44\u6599<br \/>\n<\/h2>\n<ul>\n<li>\n\t\t<a href=\"https:\/\/www.vaptcha.com\/document\" name=\"vaptcha \u5f00\u53d1\u6587\u6863\" target=\"_blank\" title=\"vaptcha \u5f00\u53d1\u6587\u6863\">https:\/\/www.vaptcha.com\/document<\/a>\n\t<\/li>\n<\/ul>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=3085\">\u7f51\u7ad9\u63a5\u5165 vaptcha \u6559\u7a0b<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u81ea\u4ece\u7f51\u7edc\u8bde\u751f\u4ee5\u6765\uff0c\u6211\u4eec\u9700\u8981\u767b\u5f55\u7684\u7f51\u5740\u57fa\u672c\u4e0a\u90fd\u9700\u8981\u9a8c\u8bc1\u7801\u8fdb\u884c\u9a8c\u8bc1\uff0c\u7528\u6765\u9632\u6b62\u4e00\u4e9b\u653b\u51fb\u65e0\u9650\u767b\u5f55\u548c\u6ce8\u518c\u884c\u4e3a\u3002\u4ee5\u5f80\u7684\u9a8c\u8bc1 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5],"tags":[878,882,1695,1253,1265],"class_list":["post-3085","post","type-post","status-publish","format-standard","hentry","category-html5","category-java","tag-html5","tag-jqueyr","tag-vaptcha","tag-1253","tag-1265"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3085","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3085"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3085\/revisions"}],"predecessor-version":[{"id":3086,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3085\/revisions\/3086"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}