reg-service.js 861 Bytes
/**
 * 注册 model
 */
'use strict';
const PassportHelper = require('./passport-helper');
const Api = require('./reg-api');
const CaptchaServiceModel = require('./captcha-img-service');

const REGISTER_LEFT_BANNER_CODE = 'c479ec90120cae7f96e52922b4917064'; // 注册左边的banner


module.exports = class extends global.yoho.BaseModel {
    constructor(ctx) {
        super(ctx);
        this.api = new Api(ctx);
        this.captchaService = new CaptchaServiceModel(ctx);
        this.passportHelper = new PassportHelper(ctx);

        this.sendCodeToMobile = this.api.sendCodeToMobile.bind(this.api);
        this.regMobileAes = this.api.regMobileAes.bind(this.api);
        this.validMobileCode = this.api.validMobileCode.bind(this.api);
    }

    getRegData() {
        return this.passportHelper.getLeftBannerAsync(REGISTER_LEFT_BANNER_CODE);
    }
};