yyb-csg
1、登录时一直提示用户名不能为空,可是明明已经传值了呀
解决:添加cookie管理器
2、怎么获取到待受理的项目,
在python脚本的实现过程中发现,在平台受理一步中传的lid值就是受理的项目,怎么把呀受理的项目的lid值传给平台受理这个接口呢
解决:见下图
python的实现
import requests
import json
import unittest
import HTMLTestRunner url1='http://--.43.72.3:8085/systAdminUser/adminLogon' headers = {'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8','Accept':'application/json, text/javascript, */*; q=0.01','Referer':'http://121.43.72.3:8085/'}
data = {
'userName':'121',
'pwd':'123456',
'adminCode':121
} session = requests.Session() cookie_jar = session.post(url1,data).cookies cookie = requests.utils.dict_from_cookiejar(cookie_jar) r = requests.post(url=url1,data=data,headers=headers,cookies=cookie)
print(cookie)
repones = r.text
print('1',r.text)
print('2',r.status_code) '''提交借款申请'''
# url2='http://==.43.72.3:8085/systUserCenter/savePersonalLoan?random=0.7381634566158939'
# data2 = {
# 'phone':'18200717106',
# 'pro_id':'8a0bb0a65aac030e015b1d3d92ce05f5',
# 'payWay':1,
# 'loanMoney':3000,
# 'rate':8,
# 'deadline':3,
# 'deadlineType':2,
# 'loanUse':'教育'
# }
# r2 = requests.post(url=url2,data=data2,headers=headers,cookies=cookie)
# repones2=r.text
# print(r2.text)
# print(r2.status_code) '''待受理列表'''
url3='http://==.43.72.3:8085/custManage/finance/research'
data3 = {
'custName':'',
}
r3 = requests.post(url=url3,data=data3,headers=headers,cookies=cookie)
repones3=r.text
print('待受理列表:',r3.text)
print(r3.status_code) str3=r3.text
print(type(str3))
params3 = json.loads(str3)
print(type(params3))
print(params3)
print(params3['rows'][0]['lid'])
n3=params3['rows'][0]['lid'] '''平台受理'''
url4='http://==.43.72.3:8085/custManage/finance/accept-loan'
data4 = {
'ctype':'8a0bb0a652b13b390151ec84e7100c7c',
'cid':'5815042292859904',
'lid':n3,
'compIds':'4189126088606720,4189129109210112,4189135710782464'
}
r4 = requests.post(url=url4,data=data4,headers=headers,cookies=cookie)
repones4=r.text
print(r4.text)
print(r4.status_code)