cert-service.js
896 Bytes
'use strict';
const CertApi = require('./cert-api');
const CaptchaImgService = require('./captcha-img-service');
module.exports = class extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
this.api = new CertApi(ctx);
this.captchaService = new CaptchaImgService(ctx);
this.sendCertMsg = this.api.sendCertMsg.bind(this.api);
this.certMobile = this.api.certMobile.bind(this.api);
this.relateMobile = this.api.relateMobile.bind(this.api);
this.checkEmailCertTip = this.api.checkEmailCertTip.bind(this.api);
}
async certCheck(mobile, area, smsCode) {
let {code, data} = await this.api.certCheck(mobile, area, smsCode);
if (!code || code !== 200) {
return {
error: new Error('error')
};
}
return {
result: data
};
}
};