Commit f96691e9 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

修改http_post函数,增加json内容转义

parent 1d228013
......@@ -96,7 +96,8 @@ class commonFuc(object):
"""
一个post请求,返回json
"""
result = requests.post(url, data=postdata, headers=header)
# result = requests.post(url, data=postdata, headers=header)
result = requests.post(url, data=json.dumps(postdata), headers=header)
result = json.loads(result.content)
return result
......@@ -453,4 +454,10 @@ class commonFuc(object):
url = 'http://search-index.babytree.com'
else:
url = 'http://sit-search-index.babytree.com'
return url
\ No newline at end of file
return url
#随机n位字符串,返回n位字符串
def randomString(self,n):
import string
import random
s="".join(random.sample(string.ascii_letters + string.digits + "!@#$%^&*()", n))
return s
\ No newline at end of file
......@@ -72,9 +72,9 @@
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/登录外网系统/log.html' target='_blank'>登录外网系统</a></td>
<td class="details-col-elapsed"><a href='../log/外网企业注册-器械注册人/log.html' target='_blank'>外网企业注册-器械注册人</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.1</td>
<td class="details-col-elapsed">0.139</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment