-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcaptcha.js
54 lines (46 loc) · 1.11 KB
/
captcha.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
let svgCaptcha = require('svg-captcha');
let svg2img = require('svg2img');
let Create = function(client, name){
let captcha = svgCaptcha.create({noise:5});
svg2img(captcha.data, function(error, buffer) {
client.captcha = captcha.text;
let data = {};
data['data'] = 'data:image/png;base64,' + buffer.toString('base64');
data['name'] = name;
client.red({captcha: data});
});
}
module.exports = function(data){
switch(data){
case 'signIn':
Create(this, 'signIn');
break;
case 'signUp':
Create(this, 'signUp');
break;
case 'giftcode':
Create(this, 'giftcode');
break;
case 'forgotpass':
Create(this, 'forgotpass');
break;
case 'transfer':
Create(this, 'transfer');
break;
case 'chargeCard':
Create(this, 'chargeCard');
break;
case 'withdrawXu':
Create(this, 'withdrawXu');
break;
case 'withdrawCard':
Create(this, 'withdrawCard');
break;
case 'momoController':
Create(this, 'momoController');
break;
case 'bankingController':
Create(this, 'bankingController');
break;
}
}