imgcheck.js 734 Bytes
'use strict';
const PAGE = 'H5';
const serviceAPI = global.yoho.ServiceAPI.ApiUrl;

module.exports = class extends global.yoho.BaseModel {
    constructor(ctx) {
        super(ctx);
    }

    /**
     * 获取图片
     */
    gen(udid) {
        return Promise.resolve({
            code: 200,
            data: {
                verifiedGraphicCode: `${serviceAPI}passport/img-check.jpg?udid=${udid}&fromPage=${PAGE}`
            }
        });
    }

    /**
     * 校验
     */
    check(udid, captcha) {
        return this.get({
            data: {
                method: 'app.verified.graphic',
                udid: udid,
                fromPage: PAGE,
                degrees: captcha
            }
        });
    }
};