diff --git a/.gitignore b/.gitignore index 0fbbf86..2cc72b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea npm-debug.log node_modules -.DS_Store \ No newline at end of file +.DS_Store +.vs \ No newline at end of file diff --git a/demo/app.js b/demo/app.js index f69824f..bcf77c1 100644 --- a/demo/app.js +++ b/demo/app.js @@ -8,7 +8,7 @@ app.use(bodyParser.json()); app.use(bodyParser.urlencoded({extended: true})); app.use(express.static('./demo/static')); -var fullpage = require('./static/fullpage'); +var fullpage = require('./fullpage'); app.get("/gt/register-fullpage", function (req, res) { // 向极验申请每次验证所需的challenge @@ -71,7 +71,7 @@ app.post("/gt/validate-fullpage", function (req, res) { }); }); -var click = require('./static/click'); +var click = require('./click'); app.get("/gt/register-click", function (req, res) { // 向极验申请每次验证所需的challenge @@ -134,7 +134,7 @@ app.post("/gt/validate-click", function (req, res) { }); }); -var slide = require('./static/slide'); +var slide = require('./slide'); app.get("/gt/register-slide", function (req, res) { // 向极验申请每次验证所需的challenge @@ -197,7 +197,7 @@ app.post("/gt/validate-slide", function (req, res) { }); }); -var test = require('./static/test'); +var test = require('./test'); app.get("/gt/register-test", function (req, res) { // 向极验申请每次验证所需的challenge @@ -260,6 +260,35 @@ app.post("/gt/validate-test", function (req, res) { }); }); +var jsonfile = require('jsonfile'); +var uas = require('../ua-list.json'); +app.get('/get-user-agent', function (req, res) { + var ua = req.headers['user-agent']; + if (uas.indexOf(ua) === -1) { + uas.unshift(ua); + jsonfile.writeFile('./ua-list.json', uas, {spaces: 2}, function(err) { + if (err) { + console.error(err) + } + }); + } + res.send(` + + + + + + + + + +`); +}); + var port = 9977; app.listen(port, function () { console.log('listening at http://localhost:' + port) diff --git a/demo/click.js b/demo/click.js new file mode 100644 index 0000000..5bc5697 --- /dev/null +++ b/demo/click.js @@ -0,0 +1,7 @@ +var Geetest = require('../gt-sdk'); + +var captcha = new Geetest({ + geetest_id: '6216680937717fdab947ed9e71a3aaa1', + geetest_key: '0f7e44a231f89b91ff2a5f75069c4f86' +}); +module.exports = captcha; \ No newline at end of file diff --git a/demo/fullpage.js b/demo/fullpage.js new file mode 100644 index 0000000..f183041 --- /dev/null +++ b/demo/fullpage.js @@ -0,0 +1,7 @@ +var Geetest = require('../gt-sdk'); + +var captcha = new Geetest({ + geetest_id: 'e52c06c937981b90b275d0aff1d40076', + geetest_key: '02d6ff3aa1dd72ab1db7ebf90971a6e0' +}); +module.exports = captcha; \ No newline at end of file diff --git a/demo/slide.js b/demo/slide.js new file mode 100644 index 0000000..d1a7aae --- /dev/null +++ b/demo/slide.js @@ -0,0 +1,7 @@ +var Geetest = require('../gt-sdk'); + +var captcha = new Geetest({ + geetest_id: '019924a82c70bb123aae90d483087f94', + geetest_key: '5e2cdacfba726b6ef221c999ebcc47a2' +}); +module.exports = captcha; \ No newline at end of file diff --git a/demo/static/click-bind.html b/demo/static/click-bind.html new file mode 100644 index 0000000..7654f5b --- /dev/null +++ b/demo/static/click-bind.html @@ -0,0 +1,146 @@ + + + + + + 大图模式 + + + +

返回

+

大图模式

+
+
+ + +
+
+
+ + +
+
+
提交
+
+ + + + + + + + diff --git a/demo/static/click-custom.html b/demo/static/click-custom.html new file mode 100644 index 0000000..2d82710 --- /dev/null +++ b/demo/static/click-custom.html @@ -0,0 +1,155 @@ + + + + + + 大图模式 + + + +

返回

+

大图模式

+
+
+ + +
+
+
+ + +
+
+
+ +
+

正在加载验证码......

+
+
+
+
提交
+
+ + + + + + + diff --git a/demo/static/click-douyu.html b/demo/static/click-douyu.html new file mode 100644 index 0000000..1f1ed9b --- /dev/null +++ b/demo/static/click-douyu.html @@ -0,0 +1,151 @@ + + + + + + 大图模式 + + + +

返回

+

大图模式

+
+
+ + +
+
+
+ + +
+
+
+ +
+

正在加载验证码......

+
+
+
+
提交
+
+ + + + + + + + diff --git a/demo/static/click-float.html b/demo/static/click-float.html new file mode 100644 index 0000000..85d9a9c --- /dev/null +++ b/demo/static/click-float.html @@ -0,0 +1,148 @@ + + + + + + 大图模式 + + + +

返回

+

大图模式

+
+
+ + +
+
+
+ + +
+
+
+ +
+

正在加载验证码......

+
+
+
+
提交
+
+ + + + + + + + diff --git a/demo/static/click-popup-en.html b/demo/static/click-popup-en.html new file mode 100644 index 0000000..3a4ffb6 --- /dev/null +++ b/demo/static/click-popup-en.html @@ -0,0 +1,149 @@ + + + + + + 大图模式 + + + +

返回

+

大图模式

+
+
+ + +
+
+
+ + +
+
+
+ +
+

正在加载验证码......

+
+
+
+
提交
+
+ + + + + + + + diff --git a/demo/static/click.html b/demo/static/click-popup.html similarity index 100% rename from demo/static/click.html rename to demo/static/click-popup.html diff --git a/demo/static/click.js b/demo/static/click.js deleted file mode 100644 index 867a5ea..0000000 --- a/demo/static/click.js +++ /dev/null @@ -1,8 +0,0 @@ -var Geetest = require('../../gt-sdk'); - -var captcha = new Geetest({ - geetest_id: '683898b124098fd661657f731db857aa', - geetest_key: '3f204e4be8c779614b2ad5caf5a6de8e' -}); - -module.exports = captcha; \ No newline at end of file diff --git a/demo/static/comment.html b/demo/static/comment.html new file mode 100644 index 0000000..cc1c7fa --- /dev/null +++ b/demo/static/comment.html @@ -0,0 +1,174 @@ + + + + + + 发表评论场景 + + + +
+ +
+

*此处是将极验运用在评论场景的交互展示,表单随意填写, 点击"发表评论"按钮触发验证。

+
+
发表评论
+
+
+ 字号表情图片 + 发表评论请遵守论坛规则 +
+
+ +
+
+
使用签名
+
+
+ +
+
+
+
+
+ + + + + + + diff --git a/demo/static/douyu.png b/demo/static/douyu.png new file mode 100644 index 0000000..0b3f691 Binary files /dev/null and b/demo/static/douyu.png differ diff --git a/demo/static/fullpage-bind.html b/demo/static/fullpage-bind.html new file mode 100644 index 0000000..6d459af --- /dev/null +++ b/demo/static/fullpage-bind.html @@ -0,0 +1,148 @@ + + + + + + 一键通过模式 + + + +

返回

+

一键通过模式

+
+
+ + +
+
+
+ + +
+
+
提交
+
+ + + + + + + + diff --git a/demo/static/fullpage.js b/demo/static/fullpage.js deleted file mode 100644 index 5e3e180..0000000 --- a/demo/static/fullpage.js +++ /dev/null @@ -1,8 +0,0 @@ -var Geetest = require('../../gt-sdk'); - -var captcha = new Geetest({ - geetest_id: 'd84c7e8e5e27b68bc8e25c6da4556135', - geetest_key: 'de0250bcc4a5e8e7b156637b301cfe77' -}); - -module.exports = captcha; \ No newline at end of file diff --git a/demo/static/image/LOCK.png b/demo/static/image/LOCK.png new file mode 100644 index 0000000..28d9730 Binary files /dev/null and b/demo/static/image/LOCK.png differ diff --git a/demo/static/image/USER.png b/demo/static/image/USER.png new file mode 100644 index 0000000..63511cc Binary files /dev/null and b/demo/static/image/USER.png differ diff --git a/demo/static/image/qq.png b/demo/static/image/qq.png new file mode 100644 index 0000000..f88e76e Binary files /dev/null and b/demo/static/image/qq.png differ diff --git "a/demo/static/image/\345\213\276\351\200\211.png" "b/demo/static/image/\345\213\276\351\200\211.png" new file mode 100644 index 0000000..99af84a Binary files /dev/null and "b/demo/static/image/\345\213\276\351\200\211.png" differ diff --git "a/demo/static/image/\345\233\2761.png" "b/demo/static/image/\345\233\2761.png" new file mode 100644 index 0000000..d1d3ec8 Binary files /dev/null and "b/demo/static/image/\345\233\2761.png" differ diff --git "a/demo/static/image/\345\233\2762.png" "b/demo/static/image/\345\233\2762.png" new file mode 100644 index 0000000..a6b1788 Binary files /dev/null and "b/demo/static/image/\345\233\2762.png" differ diff --git "a/demo/static/image/\345\233\2763.png" "b/demo/static/image/\345\233\2763.png" new file mode 100644 index 0000000..ce34e2f Binary files /dev/null and "b/demo/static/image/\345\233\2763.png" differ diff --git "a/demo/static/image/\345\233\276\347\211\207.png" "b/demo/static/image/\345\233\276\347\211\207.png" new file mode 100644 index 0000000..40bd9b5 Binary files /dev/null and "b/demo/static/image/\345\233\276\347\211\207.png" differ diff --git "a/demo/static/image/\345\255\227\345\217\267.png" "b/demo/static/image/\345\255\227\345\217\267.png" new file mode 100644 index 0000000..6306d02 Binary files /dev/null and "b/demo/static/image/\345\255\227\345\217\267.png" differ diff --git "a/demo/static/image/\345\276\256\344\277\241.png" "b/demo/static/image/\345\276\256\344\277\241.png" new file mode 100644 index 0000000..0102ed3 Binary files /dev/null and "b/demo/static/image/\345\276\256\344\277\241.png" differ diff --git "a/demo/static/image/\345\276\256\345\215\232.png" "b/demo/static/image/\345\276\256\345\215\232.png" new file mode 100644 index 0000000..d48acb5 Binary files /dev/null and "b/demo/static/image/\345\276\256\345\215\232.png" differ diff --git "a/demo/static/image/\350\241\250\346\203\205.png" "b/demo/static/image/\350\241\250\346\203\205.png" new file mode 100644 index 0000000..5362f6d Binary files /dev/null and "b/demo/static/image/\350\241\250\346\203\205.png" differ diff --git "a/demo/static/image/\351\200\211\346\241\206.png" "b/demo/static/image/\351\200\211\346\241\206.png" new file mode 100644 index 0000000..e2a7d17 Binary files /dev/null and "b/demo/static/image/\351\200\211\346\241\206.png" differ diff --git a/demo/static/img/LOCK.png b/demo/static/img/LOCK.png new file mode 100644 index 0000000..28d9730 Binary files /dev/null and b/demo/static/img/LOCK.png differ diff --git a/demo/static/img/USER.png b/demo/static/img/USER.png new file mode 100644 index 0000000..63511cc Binary files /dev/null and b/demo/static/img/USER.png differ diff --git "a/demo/static/img/\345\213\276\351\200\211.png" "b/demo/static/img/\345\213\276\351\200\211.png" new file mode 100644 index 0000000..99af84a Binary files /dev/null and "b/demo/static/img/\345\213\276\351\200\211.png" differ diff --git "a/demo/static/img/\345\233\276\347\211\207.png" "b/demo/static/img/\345\233\276\347\211\207.png" new file mode 100644 index 0000000..40bd9b5 Binary files /dev/null and "b/demo/static/img/\345\233\276\347\211\207.png" differ diff --git "a/demo/static/img/\345\255\227\345\217\267.png" "b/demo/static/img/\345\255\227\345\217\267.png" new file mode 100644 index 0000000..6306d02 Binary files /dev/null and "b/demo/static/img/\345\255\227\345\217\267.png" differ diff --git "a/demo/static/img/\346\211\213\346\234\272\345\217\267.png" "b/demo/static/img/\346\211\213\346\234\272\345\217\267.png" new file mode 100644 index 0000000..2df008a Binary files /dev/null and "b/demo/static/img/\346\211\213\346\234\272\345\217\267.png" differ diff --git "a/demo/static/img/\350\241\250\346\203\205.png" "b/demo/static/img/\350\241\250\346\203\205.png" new file mode 100644 index 0000000..5362f6d Binary files /dev/null and "b/demo/static/img/\350\241\250\346\203\205.png" differ diff --git "a/demo/static/img/\351\200\211\346\241\206.png" "b/demo/static/img/\351\200\211\346\241\206.png" new file mode 100644 index 0000000..e2a7d17 Binary files /dev/null and "b/demo/static/img/\351\200\211\346\241\206.png" differ diff --git "a/demo/static/img/\351\252\214\350\257\201\347\240\201.png" "b/demo/static/img/\351\252\214\350\257\201\347\240\201.png" new file mode 100644 index 0000000..dc925dd Binary files /dev/null and "b/demo/static/img/\351\252\214\350\257\201\347\240\201.png" differ diff --git a/demo/static/index.html b/demo/static/index.html index ae6eaa1..fab7550 100644 --- a/demo/static/index.html +++ b/demo/static/index.html @@ -14,10 +14,10 @@ padding: 0; } li { - margin: 20px 0; + margin: 10px 0; } a { - font-size: 24px; + font-size: 18px; } @@ -25,9 +25,22 @@

demo 列表

diff --git a/demo/static/login.html b/demo/static/login.html new file mode 100644 index 0000000..0193957 --- /dev/null +++ b/demo/static/login.html @@ -0,0 +1,214 @@ + + + + + + 投票场景 + + + +
+ + +
+

*此处是将极验运用在登录场景的交互展示,表单请随意填写,点击“登录”按钮触发验证。

+ +
+
+ + + + + + + \ No newline at end of file diff --git a/demo/static/pc-register.html b/demo/static/pc-register.html new file mode 100644 index 0000000..f5ebb4c --- /dev/null +++ b/demo/static/pc-register.html @@ -0,0 +1,187 @@ + + + + + + 发送短信场景 + + + +
+ + +
+

*此处是将极验运用在注册场景的交互展示,表单请随意填写,点击“获取验证码”按钮触发验证。

+ +
+
+ + + + + + + + diff --git a/demo/static/slide-bind.html b/demo/static/slide-bind.html new file mode 100644 index 0000000..1edb141 --- /dev/null +++ b/demo/static/slide-bind.html @@ -0,0 +1,148 @@ + + + + + + 滑动模式 + + + +

返回

+

滑动模式

+
+
+ + +
+
+
+ + +
+
+
提交
+
+ + + + + + + + diff --git a/demo/static/slide-custom.html b/demo/static/slide-custom.html new file mode 100644 index 0000000..dae325c --- /dev/null +++ b/demo/static/slide-custom.html @@ -0,0 +1,157 @@ + + + + + + 滑动模式 + + + +

返回

+

滑动模式

+
+
+ + +
+
+
+ + +
+
+
+ +
+

正在加载验证码......

+
+
+
+
提交
+
+ + + + + + + diff --git a/demo/static/slide-douyu.html b/demo/static/slide-douyu.html new file mode 100644 index 0000000..127078f --- /dev/null +++ b/demo/static/slide-douyu.html @@ -0,0 +1,151 @@ + + + + + + 滑动模式 + + + +

返回

+

滑动模式

+
+
+ + +
+
+
+ + +
+
+
+ +
+

正在加载验证码......

+
+
+
+
提交
+
+ + + + + + + + diff --git a/demo/static/slide-en.html b/demo/static/slide-en.html new file mode 100644 index 0000000..c5e9914 --- /dev/null +++ b/demo/static/slide-en.html @@ -0,0 +1,149 @@ + + + + + + 滑动模式 + + + +

返回

+

滑动模式

+
+
+ + +
+
+
+ + +
+
+
+ +
+

正在加载验证码......

+
+
+
+
提交
+
+ + + + + + + + diff --git a/demo/static/slide.html b/demo/static/slide-float.html similarity index 99% rename from demo/static/slide.html rename to demo/static/slide-float.html index 0a6ec70..40f0e71 100644 --- a/demo/static/slide.html +++ b/demo/static/slide-float.html @@ -118,6 +118,7 @@

滑动模式

}); }) // 更多接口说明请参见:http://docs.geetest.com/install/client/web-front/ + window.gt = captchaObj; }; diff --git a/demo/static/slide-popup.html b/demo/static/slide-popup.html new file mode 100644 index 0000000..12a904b --- /dev/null +++ b/demo/static/slide-popup.html @@ -0,0 +1,149 @@ + + + + + + 滑动模式 + + + +

返回

+

滑动模式

+
+
+ + +
+
+
+ + +
+
+
+ +
+

正在加载验证码......

+
+
+
+
提交
+
+ + + + + + + + diff --git a/demo/static/slide.js b/demo/static/slide.js deleted file mode 100644 index f7801a0..0000000 --- a/demo/static/slide.js +++ /dev/null @@ -1,8 +0,0 @@ -var Geetest = require('../../gt-sdk'); - -var captcha = new Geetest({ - geetest_id: 'e6721cd02ebe3ee262c9b84337367787', - geetest_key: 'a2a4a900f75241998c442274f3e1e492' -}); - -module.exports = captcha; \ No newline at end of file diff --git a/demo/static/vote.html b/demo/static/vote.html new file mode 100644 index 0000000..10d7a98 --- /dev/null +++ b/demo/static/vote.html @@ -0,0 +1,193 @@ + + + + + + 投票场景 + + + +
+ + +
+

*此处是将极验运用在投票场景的交互展示,请随意勾选投票项,点击“投票”按钮触发验证。

+
+
+

航拍摄影“最佳人气奖”投选活动

+

选出您最喜欢的作品 (单选)

+
+
+
+ +

+ + No.23 +

+
+
+ +

+ + No.10 +

+
+
+ +

+ + No.56 +

+
+
请选择投票的摄影照片
+
+
+ 投票 +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/demo/static/test.js b/demo/test.js similarity index 87% rename from demo/static/test.js rename to demo/test.js index 6d5abe1..2ade1c0 100644 --- a/demo/static/test.js +++ b/demo/test.js @@ -1,4 +1,4 @@ -var Geetest = require('../../gt-sdk'); +var Geetest = require('../gt-sdk'); var captcha = new Geetest({ geetest_id: '4faf9dd37eb683586977947ce87a866a', diff --git a/ua-list.json b/ua-list.json new file mode 100644 index 0000000..0cff2a5 --- /dev/null +++ b/ua-list.json @@ -0,0 +1,10 @@ +[ + "Mozilla/5.0 (Linux; Android 7.0; HUAWEI NXT-AL10 Build/HUAWEINXT-AL10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Firefox/52.0", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.1 Safari/603.1.30", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0.1 Safari/602.2.14", + "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1", + "Mozilla/5.0 (Linux; Android 7.0; HUAWEI NXT-AL10 Build/HUAWEINXT-AL10; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043128 Safari/537.36 MicroMessenger/6.5.7.1041 NetType/WIFI Language/zh_CN", + "Mozilla/5.0 (Linux; Android 5.1.1; HUAWEI P7-L00 Build/HuaweiP7-L00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043128 Safari/537.36 V1_AND_SQ_6.7.1_500_YYB_D QQ/6.7.1.3105 NetType/WIFI WebP/0.3.0 Pixel/720" +]