Blame view

apps/passport/models/reg-service.js 801 Bytes
毕凯 authored
1 2 3 4 5
/**
 * 注册 model
 */
'use strict';
const passportHelper = require('./passport-helper');
htoooth authored
6
const Api = require('./reg-api');
htoooth authored
7 8
const CaptchaServiceModel = require('./captcha-img-service');
毕凯 authored
9 10 11
const REGISTER_LEFT_BANNER_CODE = 'c479ec90120cae7f96e52922b4917064'; // 注册左边的banner

htoooth authored
12 13 14
module.exports = class extends global.yoho.BaseModel {
    constructor(ctx) {
        super(ctx);
周少峰 authored
15
        this.api = new Api(ctx);
htoooth authored
16
        this.captchaService = new CaptchaServiceModel(ctx);
htoooth authored
17 18 19

        this.sendCodeToMobile = this.api.sendCodeToMobile.bind(this.api);
        this.regMobileAes = this.api.regMobileAes.bind(this.api);
htoooth authored
20
        this.validMobileCode = this.api.validMobileCode.bind(this.api);
htoooth authored
21 22 23 24 25 26
    }

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