Example #1
0
 def getJsonPaths(cls):
     if not cls.JSONPATHS:
         cls.JSONPATHS = {
             '/open/h5v3/user/createAccount': cls.doCreateAccount,
             '/open/h5v3/user/loginByDevId': cls.doLoginByDevId,
             '/open/h5v3/user/loginByMobile': cls.doLoginByMobile,
             '/open/h5v3/user/loginByTyID': cls.doLoginByTyID,
             '/open/h5v3/user/loginByMail': cls.doLoginByMail,
             '/open/h5v3/user/loginBySnsID': cls.doLoginBySnsID,
             '/open/h5v3/user/loginByAccount': cls.doLoginByAccount,
             '/open/h5v3/user/processSnsId': cls.doProcessSnsID,
             '/open/h5v3/user/getSmsBindCode': cls.doGetSmsBindCode,
             '/open/h5v3/user/checkSmsBind': cls.doCheckSmsBind,
             '/open/h5v3/user/getSmsVerifyCode': cls.doGetSmsVerifyCode,
             '/open/h5v3/user/bindMobileByVerifyCode':
             cls.doBindMobileByVerifyCode,
             '/open/h5v3/user/bindBySnsId': cls.doBindBySnsId,
             '/open/h5v3/user/bindByEmail': cls.doBindByEmail,
             '/open/h5v3/user/renewAuthorCodeByTyId':
             cls.doRenewAuthorCodeByTyId,
             '/open/h5v3/user/getUserInfo': cls.doGetUserInfo,
             '/open/h5v3/user/setUserInfo': cls.doSetUserInfo,
             '/open/h5v3/user/setPasswd': cls.doSetPasswd,
             '/open/h5v3/user/setPasswdByVerifyCode':
             cls.doSetPasswdByVerifyCode,
             '/open/h5v3/user/setUserAvatar': cls.doSetUserAvatar,
             '/open/h5v3/user/reportContacts': cls.doReportContacts,
             '/open/h5v3/user/queryForbidden': cls.doQueryForbidden,
             '/open/h5v3/user/setForbidden': cls.doSetForbidden,
             '/open/h5v3/user/youkuLoginCallback': cls.doYoukuLoginCallback,
             '/open/h5v3/customtable/notify': cls.doCustomTableNotify
         }
         AccountCheck.__init_checker__()
     return cls.JSONPATHS
Example #2
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
Example #3
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
Example #4
0
    def doLoginBySnsID(cls, rpath):
        isReturn, params = AccountCheck.login_check(rpath, 5)
        if isReturn:
            return params

        AccountCheck.set_user_check(rpath, params)
        mo = TyContext.Cls_MsgPack()
        AccountLogin.doProcessSnsID(params, mo)
        return mo
Example #5
0
    def doSetUserInfo(cls, rpath):
        isReturn, params = AccountCheck.normal_check(rpath)
        if isReturn:
            return params

        isReturn, params = AccountCheck.set_user_check(rpath, params)
        if isReturn:
            return params

        mo = TyContext.Cls_MsgPack()
        AccountInfo.doSetUserInfo(params, mo)
        return mo
Example #6
0
 def doCheckSmsBind(cls, rpath):
     userId = TyContext.RunHttp.getRequestParamInt('userId', 0)
     if userId > 0:
         isReturn, params = AccountCheck.normal_check(rpath)
         if isReturn:
             return params
     else:
         isReturn, params = AccountCheck.onekeylogin_check(rpath)
         if isReturn:
             return params
     mo = TyContext.Cls_MsgPack()
     AccountSms.doCheckSmsBind(params, mo)
     return mo
Example #7
0
    def doBindBySnsId(cls, rpath):
        isReturn, params = AccountCheck.normal_check(rpath)
        if isReturn:
            return params

        isReturn, snsId = AccountCheck.check_param_snsid(rpath)
        if isReturn:
            return snsId
        params['snsId'] = snsId
        params['snsToken'] = TyContext.RunHttp.getRequestParam('snsToken')

        mo = TyContext.Cls_MsgPack()
        AccountBind.doBindBySnsId(params, mo)
        return mo
Example #8
0
    def doSetUserAvatar(cls, rpath):
        isReturn, params = AccountCheck.normal_check(rpath)
        if isReturn:
            return params

        url = TyContext.RunHttp.getRequestParam('url', '').strip()
        data = TyContext.RunHttp.getRequestParam('data', '')
        mo = TyContext.Cls_MsgPack()

        is_url_error = len(url) > 0 and (len(url) > 125 or url.find('"') >= 0
                                         or url.find("'") >= 0)
        if (len(url) == 0 and len(data) == 0) or is_url_error:
            mo.setResult('code', 1)
            mo.setResult('info', '输入参数错误')
            return mo
        if len(data) > 0:
            try:
                data = base64.b64decode(data)
            except:
                mo.setResult('code', 1)
                mo.setResult('info', '图像数据错误')
                return mo
        params['url'] = url
        params['data'] = data
        AccountInfo.doSetUserAvatar(params, mo)
        return mo
Example #9
0
 def doRenewAuthorCodeByTyId(cls, rpath):
     isReturn, params = AccountCheck.login_check(rpath, 3)
     if isReturn:
         return params
     mo = TyContext.Cls_MsgPack()
     AccountLogin.doRenewAuthorCodeByTyId(params, mo)
     return mo
Example #10
0
 def doCreateAccount(cls, rpath):
     isReturn, params = AccountCheck.login_check(rpath, 7)
     if isReturn:
         return params
     mo = TyContext.Cls_MsgPack()
     AccountLogin.doCreateAccount(params, mo)
     return mo
Example #11
0
 def doLoginByTyID(cls, rpath):
     isReturn, params = AccountCheck.login_check(rpath, 3)
     if isReturn:
         return params
     mo = TyContext.Cls_MsgPack()
     AccountLogin.doLoginByTyID(params, mo)
     return mo
Example #12
0
    def doBindMobileByVerifyCode(cls, rpath):
        isReturn, params = AccountCheck.normal_check(rpath)
        if isReturn:
            return 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

        mo = TyContext.Cls_MsgPack()
        AccountSms.doBindMobileByVerifyCode(params, mo)
        return mo
Example #13
0
    def getHtmlPaths(cls):
        if not cls.HTMLPATHS:
            cls.HTMLPATHS = {
                # '/open/h5vc/user/smsCallback': cls.doManDaoSmsBindCallBack,
                # '/open/h5vc/user/smsCallback/baifen': cls.doBaiFenSmsBindCallBack,

                # for ty/360 http api
                # '/open/h5v3/user/gettyid' : TuYouSLL.get_tyid,
                '/open/h5v3/user/gid2qid': TuYouSLL.gid2qid,
                '/open/h5v3/user/revokeqid': TuYouSLL.revoke_qid,

                # for pc qipai (360 kaiping)
                '/open/h5v3/user/kaiping/login': TuYouSLL.kp_login,
                '/open/h5v3/user/kaiping/code': TuYouSLL.kp_code,
                '/open/h5v3/user/kaiping/checkuser': TuYouSLL.kp_checkuser,
                '/open/h5v3/user/kaiping/exchange': TuYouSLL.kp_exchange,
            }
            AccountCheck.__init_checker__()
        return cls.HTMLPATHS
Example #14
0
    def doBindByEmail(cls, rpath):
        isReturn, params = AccountCheck.normal_check(rpath)
        if isReturn:
            return params
        appId = params['appId']
        clientId = params['clientId']
        if (appId == 6 and (clientId.find('Android_2.8_') >= 0 or clientId.find('Android_2.81_') >= 0)) or \
                (appId == 7 and (clientId.find('Android_2.28_') >= 0)):
            mo = TyContext.Cls_MsgPack()
            mo.setResult('code', 1)
            mo.setResult('info', '暂未开通此功能')
            return mo

        isReturn, mail = AccountCheck.check_param_mail(rpath)
        if isReturn:
            return mail
        params['mail'] = mail

        mo = TyContext.Cls_MsgPack()
        AccountBind.doBindByEmail(params, mo)
        return mo
Example #15
0
    def doGetSmsVerifyCode(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
        params['whatfor'] = TyContext.RunHttp.getRequestParam('whatfor', '')

        mo = TyContext.Cls_MsgPack()
        AccountSms.doGetSmsVerifyCode(params, mo)
        return mo
Example #16
0
    def doReportContacts(cls, rpath):
        isReturn, params = AccountCheck.normal_check(rpath)
        if isReturn:
            return params
        mo = TyContext.Cls_MsgPack()
        contacts = TyContext.RunHttp.getRequestParam('contacts', '')
        if contacts != '':
            contacts = AccountVerify.decode_item(contacts)

        TyContext.ftlog.info('doReportContacts appId=', params['appId'],
                             'userId=', params['userId'], 'contacts=',
                             contacts)
        mo.setResult('code', 0)
        mo.setResult('info', 'success')
        return mo
Example #17
0
    def doCustomTableNotify(cls, rpath):
        isReturn, params = AccountCheck.normal_check(rpath)
        if isReturn:
            return params

        # mo = TyContext.Cls_MsgPack()
        appId = params['appId']
        userId = params['userId']
        clientId = params['clientId']
        msg = params['msg']
        customTableId = TyContext.RunHttp.getRequestParam('customTableId', '')

        url = cls._get_game_server_callback_url(
            appId, clientId, '/v2/game/h5/customtable/chat')
        cls.http_request(
            url, {
                'userId': userId,
                'appId': appId,
                'customTableId': customTableId,
                'msg': msg
            })
Example #18
0
 def jsonApiIntercept(cls, rpath):
     isReturn, params = AccountCheck.normal_check(rpath)
     return isReturn, params