captcha-api.js
969 Bytes
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
/**
* Created by TaoHuang on 2016/12/12.
*/
'use strict';
const apiUrl = global.yoho.config.domains.service;
const config = global.yoho.config;
const PAGE = 'pc';
module.exports = class extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
}
gen(id) {
if (id) {
return Promise.resolve({
code: 200,
data: {
url: `${apiUrl}passport/img-check.jpg?udid=${id}&fromPage=${PAGE}&client_type=${config.app}`
}
});
} else {
return Promise.reject({
code: 400,
message: '生成二维码失败,请重新刷新!'
});
}
}
check(id, captcha) {
return this.get({
data: {
method: 'app.verified.graphic',
udid: id,
fromPage: PAGE,
degrees: captcha
}
});
}
};