def post(self): """ 发送验证码 :param user_mobile: 手机号码 :return: """ user_type = _USER_TYPE_INVEST if check_use_source(_USE_SOURCE_TYPE_1): argument_dict, aes_share_key, aes_nonce = self.get_argument_dict( must_keys=[ 'user_mobile', 'pvcode', 'register_by', 'mobile_country_code' ], check_token=False, invariable_key=False, api_type=user_type, request_type=_REQUEST_TYPE_REGISTER) user_mobile = str(argument_dict['user_mobile']) pvcode = str(argument_dict['pvcode']) register_by = argument_dict['register_by'] mobile_country_code = argument_dict['mobile_country_code'] send_type = _VCODE_REGISTER service = VcodeService(aes_share_key=aes_share_key, aes_nonce=aes_nonce) # 校验图形验证码 service.check_vcode_picture(pvcode) # 校验是否已经注册 result = service.send_vcode_by_register_type( send_type, user_mobile, user_type=user_type, register_by=register_by, mobile_country_code=mobile_country_code) else: argument_dict, aes_share_key, aes_nonce = self.get_argument_dict( must_keys=['user_mobile', 'pvcode'], check_token=False, invariable_key=False, api_type=user_type, request_type=_REQUEST_TYPE_REGISTER) user_mobile = str(argument_dict['user_mobile']) pvcode = str(argument_dict['pvcode']) send_type = _VCODE_REGISTER service = VcodeService(aes_share_key=aes_share_key, aes_nonce=aes_nonce) # 校验图形验证码 service.check_vcode_picture(pvcode) # 校验是否已经注册 result = service.send_vcode(send_type, user_mobile, user_type=user_type) return result, aes_share_key, aes_nonce
def post(self): """ 发送验证码 :param user_mobile: 手机号码 :return: """ user_type = _USER_TYPE_INVEST if check_use_source(_USE_SOURCE_TYPE_1): argument_dict, aes_share_key, aes_nonce = self.get_argument_dict( must_keys=[ 'user_id', 'mobile', 'pvcode', 'mobile_country_code' ], api_type=user_type, request_type=_REQUEST_TYPE_LOGIN) user_id = str(argument_dict['user_id']) user_mobile = argument_dict['mobile'] mobile_country_code = argument_dict['mobile_country_code'] pvcode = argument_dict['pvcode'] register_by = _REGISTER_SET_MOBILE send_type = _VCODE_SET_MOBILE vcode_service = VcodeService(aes_share_key=aes_share_key, aes_nonce=aes_nonce) # 校验图形验证码 vcode_service.check_vcode_picture(pvcode, user_type=_USER_TYPE_INVEST, vcode_type=_VCODE_SET_MOBILE) # 校验是否已经注册 result = vcode_service.send_vcode_by_register_type( send_type, user_mobile, user_type=user_type, register_by=register_by, mobile_country_code=mobile_country_code, check_user_id=user_id, ) return result, aes_share_key, aes_nonce else: self.return_error(10004)
def post(self): """ 发送验证码 :param user_mobile: 手机号码 :return: """ user_type = _USER_TYPE_INVEST if check_use_source(_USE_SOURCE_TYPE_1): argument_dict, aes_share_key, aes_nonce = self.get_argument_dict( must_keys=['user_id', 'register_by', 'pvcode'], api_type=user_type, request_type=_REQUEST_TYPE_LOGIN) user_id = str(argument_dict['user_id']) register_by = argument_dict['register_by'] pvcode = argument_dict['pvcode'] if register_by not in [ _REGISTER_SET_PAYPD_EMAIL, _REGISTER_SET_PAYPD_MOBILE, ]: self.return_error(30223) send_type = _VCODE_SET_PAY_PD service = VcodeService(aes_share_key=aes_share_key, aes_nonce=aes_nonce) # 校验图形验证码 service.check_vcode_picture(pvcode, user_type=_USER_TYPE_INVEST, vcode_type=_VCODE_SET_PAY_PD) # 校验是否已经注册 result = service.send_vcode_by_register_type( send_type, user_id, user_type=user_type, register_by=register_by) return result, aes_share_key, aes_nonce else: self.return_error(10004)