duplicateToken.py
879 Bytes
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import urllib3
from commons import common as com
from commons.MySession import hg
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
class duplicateToken():
"称重防重接口,返回唯一的commit_token"
url = "http://test.gateway.diligrp.com:8285/card-web/appCommon/duplicateToken.action"
header = {
"UAP_accessToken": "demo",
"UAP_refreshToken": "demo",
"UAP_firmId": "9",
"Host": "test.gateway.diligrp.com:8285",
"Connection":"Keep-Alive"}
def __init__(self):
self.url = duplicateToken.url
self.header = duplicateToken.header
def duplicate_commit_token(self,market):
re = market.get(url=self.url, headers=self.header)
return re.json()["data"]
print(duplicateToken().duplicate_commit_token(hg))