Example #1
0
def packRegisterParam():
    param = params.genericPackParam()
    param["method"] = consts.REGISTER
    biz = {}
    biz['mobileNo'] = '+6308132000100'  # 手机号
    biz['password'] = str(sec.encrypt(b'123456'), 'utf-8')
    biz['geoInfo'] = str(geo.packGeo())  # 地理geo必传,否则会落库报latitude非空键异常
    param["bizContent"] = str(biz)  # 业务数据
    printParam(param)
    return param
Example #2
0
def packLoginParam():
    param = params.genericPackParam()
    param["method"] = consts.LOGIN
    biz = {}
    biz['loginType'] = "ORIGIN"
    biz['mobileNo'] = '+6308132000100'  # 手机号
    biz['password'] = str(sec.encrypt(b'123456'), 'utf-8')
    biz['geoInfo'] = str(geo.packGeo())  # 地理geo必传,否则会落库报latitude非空键异常
    param["bizContent"] = str(biz)  # 业务数据
    # printParam(param)
    return param
Example #3
0
def packRegisterParam(paramIn):
    paramOut = params.genericPackParam()
    paramOut["method"] = consts.REGISTER
    biz = {}
    biz['mobileNo'] = paramIn['mobileNo']  # 手机号
    pwd = paramIn['password']
    biz['password'] = str(security.encrypt(bytes(pwd, encoding="utf8")),
                          'utf-8')
    biz['geoInfo'] = str(geo.packGeo())  # 地理geo必传,否则会落库报latitude非空键异常
    paramOut["bizContent"] = str(biz)  # 业务数据
    return paramOut
Example #4
0
def packLoginParam(mobile, bytePwd):
    paramIn = params.genericPackParam()
    paramIn["method"] = consts.LOGIN
    biz = {}
    biz['loginType'] = "ORIGIN"
    biz['mobileNo'] = mobile  # 手机号
    biz['password'] = str(security.encrypt(bytePwd), 'utf-8')
    biz['geoInfo'] = str(geo.packGeo())  # 地理geo必传,否则会落库报latitude非空键异常
    paramIn["bizContent"] = str(biz)  # 业务数据
    Gatlin.printParam(paramIn)
    return paramIn
Example #5
0
 def prepare(self):
     public_req_param = params.genericPackParam()
     util.inject_all_soft(public_req_param,
                          self.context['session'])  # 取初始化参数
     self.pack_method(public_req_param)
     biz = {
         "password":
         str(
             sec.encrypt(
                 bytes(self.context['environ']['newtpassword'],
                       encoding='utf8')), 'utf-8'),
         "pwdType":
         "T"
     }
     public_req_param['userNo'] = self.context['session']['userNo']
     public_req_param['token'] = self.context['session']['token']
     public_req_param["bizContent"] = str(biz)  # 业务数据
     public_req_param["deviceInfo"] = str(
         self.context['session']['deviceInfo'])  # deviceInfo需要转换
     self.context['request'] = public_req_param  # 归根到底目的是为了拼装request参数
     print('ItemCommitTPwd', json.dumps(public_req_param))
Example #6
0
 def prepare(self):
     public_req_param = params.genericPackParam()
     util.inject_all_soft(public_req_param,
                          self.context['session'])  # 取初始化参数
     ENV = self.context['environ']['env']
     sec.init(ENV)  # 初始化加密的公私钥
     self.pack_method(public_req_param)
     biz = {}
     biz['loginType'] = "ORIGIN"
     biz['mobileNo'] = self.context['environ'][
         'mobileNo']  # 手机号和password放到了environ里面
     biz['password'] = str(
         sec.encrypt(
             bytes(self.context['environ']['password'], encoding='utf8')),
         'utf-8')
     biz['geoInfo'] = str(
         self.context['session']['geo'])  # 地理geo必传,否则会落库报latitude非空键异常
     public_req_param["bizContent"] = str(biz)  # 业务数据
     public_req_param["deviceInfo"] = str(
         self.context['session']['deviceInfo'])
     self.context['request'] = public_req_param  # 归根到底目的是为了拼装request参数
     print("LOGIN PARAM", public_req_param)