コード例 #1
0
    def login(self):
        self.logger.info("[浦发]2.3 开始校验请求参数")
        if not self._identityCard:
            return json.dumps({'retCode': '0001', 'retMsg': '身份证信息校验为空'})
        if not self._verifyCode:
            return json.dumps({'retCode': '0001', 'retMsg': '验证码信息校验为空'})
        self.logger.info("[浦发]2.4 请求参数校验通过,进行登录查询操作")
        data = {"code" : self._verifyCode, "module" : "applyProgress"}
        self.logger.info("[浦发]2.5 开始登录操作,请求参数为:%s" % data)
        result = self.s.post(
            "https://weixin.spdbccc.com.cn//wx-page-applyandpost/applyProgress/checkCode.do", data=data)
        self.logger.info("[浦发]2.6 登录结束,响应信息为:%s" % result.text)
        self.logger.info("[浦发]2.7 根据响应结果校验登录是否成功")
        if result.text == "003":
            return json.dumps({'retCode': '0001', 'retMsg': '输入的图形验证码错误,请重新输入'})
        if result.text == "001":
            return json.dumps({'retCode': '0001', 'retMsg': '当前验证码已失效,请重新输入'})

        self.logger.info("[浦发]2.8 登录成功,开始查询卡进度")
        ras_public_key = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDWRU8L6AeYiaAZEuyVjm+PlY2F7cFAjbN7g18civ+jRM1wVHSFweSObcIST6ZNdUWBd++9conWUnS8E4AVNObkvERO+vut2GrNuc91Vul39/9Xpc8mfXvqK5YO/HnkOpH8SQG0EPLnLmBKv4v4poChqXu00RyMkvLfXgGAXKzSWwIDAQAB"
        data = {"zjhm": baseback.open_rsa_encod(self,self._identityCard,ras_public_key),
                "valcode": baseback.open_rsa_encod(self,self._verifyCode,ras_public_key), "cardType": baseback.open_rsa_encod(self,"01",ras_public_key)}
        self.logger.info("[浦发]2.9 开始查询卡进度,请求参数为:%s" % data)
        result = self.s.post(
            "https://weixin.spdbccc.com.cn/wx-page-applyandpost/applyProgress/getApplyProgress.do", data=data)
        self.logger.info("[浦发]2.10 查询结束,响应信息为:%s" % result.text)
        self.logger.info("[浦发]2.11 开始解析响应结果")
        soup = BeautifulSoup(result.text,'lxml')
        result =[]
        for node in soup.find_all('td'):
            if node.string != None:
                result.append(node.string)
        result = result[1::2]
        self.logger.info("[浦发]2.12 解析结束,解析结果为:%s" % result)
        return json.dumps({'retCode': '0000', 'result': baseback.result_dispose(self,"pufa",result)})
コード例 #2
0
 def login(self):
     self.logger.info("[光大]2.6 开始校验请求参数")
     if not self._identityCard:
         return json.dumps({'retCode': '0001', 'retMsg': '身份证信息校验为空'})
     if not self._smsVerifyCode:
         return json.dumps({'retCode': '0001', 'retMsg': '验证码信息校验为空'})
     if not self._verifyCode:
         return json.dumps({'retCode': '0001', 'retMsg': '验证码信息校验为空'})
     if not self._userName:
         return json.dumps({'retCode': '0001', 'retMsg': '用户名信息校验为空'})
     self.logger.info("[光大]2.7 请求参数校验通过,进行登录查询操作")
     data = {
         "activity_code": self._smsVerifyCode,
         "id_no": self._identityCard,
         "card_id_type": "A",
         "name": self._userName,
         "ver_code": self._verifyCode,
         "condition-name-str-eq:": self._userName,
         "condition-id_no-str-eq": self._identityCard
     }
     self.logger.info("[光大]2.8 开始登录操作,请求参数为:%s" % data)
     result = self.s.post(
         "https://xyk.cebbank.com/cebmms/apply/fz/card-app-status-query.htm",
         data=data)
     self.logger.info("[光大]2.9 登录结束,响应信息为:%s" % result.text)
     self.logger.info("[光大]2.10 开始解析响应结果")
     soup = BeautifulSoup(result.text, 'lxml')
     result = soup.find_all("td", "sj_schs")
     resultList = []
     for key in result:
         text = key.text
         text = "".join(text.split())
         resultList.append(text)
     self.logger.info("[光大]2.11 解析结束,解析结果为:%s" % resultList)
     if len(resultList) == 0:
         return json.dumps({'retCode': '0001', 'retMsg': '未查到有效数据'})
     return json.dumps({
         'retCode':
         '0000',
         'result':
         baseback.result_dispose(self, "guangda", resultList)
     })
コード例 #3
0
    def login(self):
        self.logger.info("[招商]2.6 开始校验请求参数")
        if not self._identityCard:
            return json.dumps({'retCode': '0001', 'retMsg': '身份证信息校验为空'})
        if not self._smsVerifyCode:
            return json.dumps({'retCode': '0001', 'retMsg': '验证码信息校验为空'})
        self.logger.info("[招商]2.7 请求参数校验通过,进行登录查询操作")
        data = {
            "smscode": self._smsVerifyCode,
            "cardid": self._identityCard,
            "cardtype": "01"
        }
        self.logger.info("[招商]2.8 开始登录操作,请求参数为:%s" % data)
        result = self.s.post(
            "https://ccclub.cmbchina.com/mca/Service/CWAService.asmx/PQS_QuerySchedule",
            data=json.dumps(data))
        self.logger.info("[招商]2.9 登录结束,响应信息为:%s" % result.text)
        self.logger.info("[招商]2.10 校验登录信息")
        jsonObj = json.loads(result.text)
        returninfo = jsonObj.get("d", ["0001", "登录校验不通过"])
        if returninfo[0] != 0:
            return json.dumps({'retCode': '0001', 'retMsg': returninfo[1]})

        self.logger.info("[招商]2.11 登录成功,开始查询卡进度")
        codeUrl = "https://ccclub.cmbchina.com/mca/MQueryRlt.aspx?serino=%s" % (
            random.random())
        result = self.s.get(codeUrl)
        self.logger.info("[招商]2.12 开始查询卡进度,响应信息为:%s" % result.text)
        self.logger.info("[招商]2.13 开始解析响应结果")
        soup = BeautifulSoup(result.text, 'lxml')
        result = soup.find(id="ctl00_ContentPlaceHolder1_hidresult")
        result = result.get('value')
        result = json.loads(result)
        self.logger.info("[招商]2.14 解析结束,解析结果为:%s" % result)
        return json.dumps({
            'retCode':
            '0000',
            'result':
            baseback.result_dispose(self, "zhaoshang", result)
        })
コード例 #4
0
 def login(self):
     self.logger.info("[民生]2.7 开始校验请求参数")
     if not self._identityCard:
         return json.dumps({'retCode': '0001', 'retMsg': '身份证信息校验为空'})
     if not self._smsVerifyCode:
         return json.dumps({'retCode': '0001', 'retMsg': '短信验证码校验为空'})
     self.logger.info("[民生]2.8 请求参数校验通过,进行登录查询操作")
     codeUrl = "https://creditcard.cmbc.com.cn/fe/op_exchange_rate/messageSubmit.gsp?sKeyType=01&sCustId=%s&DYPW=%s&mar=1" % (
         self._identityCard, self._smsVerifyCode)
     self.logger.info("[民生]2.9 始登录操作,请求参数为:%s" % codeUrl)
     result = self.s.get(codeUrl)
     self.logger.info("[民生]2.10 登录结束,响应信息为:%s" % result.text)
     self.logger.info("[民生]2.11 根据响应结果校验登录是否成功")
     jsonObj = json.loads(result.text)
     if jsonObj["retCode"] != "0000":
         return json.dumps({'retCode': '0001', 'retMsg': '短信验证码验证失败'})
     self.logger.info("[民生]2.12 登录成功,开始查询卡进度")
     result = self.s.get(
         "https://creditcard.cmbc.com.cn/fe/op_exchange_rate/cardProgressStep.gsp?COUT=1&FOUT=5&isVCard="
     )
     self.logger.info("[民生]2.13 查询结束,响应信息为:%s" % result.text)
     self.logger.info("[民生]2.14 开始解析响应结果")
     jsonObj = json.loads(result.text)
     if jsonObj["retCode"] != "0000":
         return json.dumps({'retCode': '0001', 'retMsg': '未查询到有效数据'})
     self.logger.info("[浦发]2.12 解析结束,解析结果为:%s" % jsonObj)
     cardSize = jsonObj["data"]["FOUT"]
     if int(cardSize) == 0:
         return json.dumps({'retCode': '0001', 'retMsg': '未查询到有效数据'})
     cardList = jsonObj["data"]["list"]
     return json.dumps({
         'retCode':
         '0000',
         'result':
         baseback.result_dispose(self, "minsheng", cardList)
     })
コード例 #5
0
    def login(self):
        self.logger.info("[中信]2.6 开始校验请求参数")
        if not self._identityCard:
            return json.dumps({'retCode': '0001', 'retMsg': '身份证信息校验为空'})
        if not self._mobileId:
            return json.dumps({'retCode': '0001', 'retMsg': '手机号码信息校验为空'})
        if not self._smsVerifyCode:
            return json.dumps({'retCode': '0001', 'retMsg': '短信验证码校验为空'})
        self.logger.info("[中信]2.7 请求参数校验通过,进行登录查询操作")
        data = {
            "idNumber": self._identityCard,
            "msgCode": self._smsVerifyCode,
            "idType": "1",
            "phone": self._mobileId
        }
        self.logger.info("[中信]2.8 开始登录操作,请求参数为:%s" % data)
        result = self.s.post(
            "https://creditcard.ecitic.com/citiccard/ebankUserinfo/card_progress/identitying_code",
            data=json.dumps(data))
        self.logger.info("[中信]2.9 登录结束,响应信息为:%s" % result.text)
        self.logger.info("[中信]2.10 根据响应结果校验登录是否成功")
        jsonObj = json.loads(result.text)
        returninfo = {"retCode": "01"}
        if jsonObj:
            returninfo = jsonObj['returninfo']
        retCode = "0000"
        if returninfo['retCode'] == '01':
            return json.dumps({'retCode': '0001', 'retMsg': '审批已过期'})

        if returninfo['retCode'] == '02':
            return json.dumps({'retCode': '0001', 'retMsg': '您的短信验证码填写错误'})

        if returninfo['retCode'] != '00':
            return json.dumps({
                'retCode': '0001',
                'retMsg': returninfo["retMsg"]
            })

        cardListInfo = jsonObj['cardListInfo']
        if cardListInfo["count"] == '0':
            return json.dumps({
                'retCode':
                '0001',
                'retMsg':
                '感谢您的支持,系统暂未查询到您的资料,请您核对资料是否正确。(如资料正确,您的资料有可能还没有录入系统,建议耐心等待,稍后查询)'
            })
        self.logger.info("[中信]2.11 登录成功,开始查询卡进度")
        key = cardListInfo["key"]
        data = {"key": key}
        self.logger.info("[中信]2.12 开始查询卡进度,请求参数为:%s" % data)
        result = self.s.post(
            "https://creditcard.ecitic.com/citiccard/ebankUserinfo/card_progress/card_list",
            data=json.dumps(data))
        self.logger.info("[中信]2.13 查询结束,响应信息为:%s" % result.text)
        self.logger.info("[中信]2.14 开始解析响应结果")
        jsonObj = json.loads(result.text)
        returninfo = {"retCode": "01"}
        if jsonObj:
            returninfo = jsonObj['returninfo']
        retCode = "0000"
        if returninfo['retCode'] != '00':
            return json.dumps({
                'retCode': '0001',
                'retMsg': returninfo["retMsg"]
            })
        cardList = jsonObj['cardList']
        self.logger.info("[中信]2.15 解析结束,解析结果为:%s" % cardList)
        return json.dumps({
            'retCode':
            '0000',
            'result':
            baseback.result_dispose(self, "zhongxin", cardList)
        })