reset.js 681 Bytes
/*
 * @Author: Targaryen
 * @Date: 2017-04-13 10:25:56
 * @Last Modified by: Targaryen
 */

/* ******************
 * 重置密码
 ********************/

'use strict';
const aes = require('./aes-pwd');

class ResetModel extends global.yoho.BaseModel {
    constructor(ctx) {
        super(ctx);
    }

    /**
     * 重置密码
     * @param {*} params
     */
    resetPassword(params) {
        return this.post({data: {
            method: 'app.password.modPwdByCode',
            uid: params.uid,
            oldPwd: aes.aesPwd(params.oldPwd),
            newPwd: aes.aesPwd(params.newPwd),
            token: params.token
        }});
    }
}


module.exports = ResetModel;