Exemple #1
0
    def doSetPasswd(cls, rpath):
        isReturn, params = AccountCheck.normal_check(rpath)
        if isReturn:
            return params

        # 获取玩家修改密码次数
        userId = params['userId']
        changePwdCount = TyContext.RedisUser.execute(userId, 'HGET', 'user:'******'changePwdCount')
        #         TyContext.ftlog.info(cls.__name__, 'doSetPasswd->changePwdCount=', changePwdCount)
        if changePwdCount == None:
            changePwdCount = 0
        if int(changePwdCount) > 0:
            isReturn, oldpasswd = AccountCheck.check_param_password(rpath, 'oldpasswd')
            if isReturn:
                return oldpasswd
            params['oldpasswd'] = oldpasswd

        isReturn, newpasswd = AccountCheck.check_param_password(rpath, 'newpasswd', isSet=True)
        if isReturn:
            return newpasswd
        params['newpasswd'] = newpasswd

        mo = TyContext.Cls_MsgPack()
        AccountInfo.doSetPasswd(params, mo)
        return mo
Exemple #2
0
    def doSetPasswdByVerifyCode(cls, rpath):
        # isReturn, params = AccountCheck.normal_check( rpath)
        # if isReturn :
        #     return params
        params = {}
        isReturn, mobile = AccountCheck.check_param_mobile(rpath)
        if isReturn:
            return mobile
        params['mobile'] = mobile

        isReturn, vcode = AccountCheck.check_param_verify_code(rpath)
        if isReturn:
            return vcode
        params['vcode'] = vcode

        isReturn, newpasswd = AccountCheck.check_param_password(rpath, 'newpasswd', isSet=True)
        if isReturn:
            return newpasswd
        params['newpasswd'] = newpasswd

        mo = TyContext.Cls_MsgPack()
        AccountSms.doSetPasswordByVerifyCode(params, mo)
        return mo