duplicateToken.py
1.24 KB
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import urllib3
from commons import common as com
from commons.MySession import my,s1,s2
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
class duplicateToken():
url = "http://test.gateway.diligrp.com:8285/jmsf-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.replace("http://test.", com.get_global_config("global_data", "environment", "en"))
self.header = duplicateToken.header
self.header["UAP_accessToken"] = s2.cookies["UAP_accessToken"]
self.header["UAP_refreshToken"] = s2.cookies["UAP_refreshToken"]
self.header["UAP_firmId"] = s2.cookies["UAP_firmId"]
self.header["Host"] = com.get_global_config("global_data", "host", "gateway")
def jmsf_duplicate_commit_token(self):
re = s2.get(url=self.url, headers=self.header,proxies=my.myproxies)
return re.json()["data"]
# du=duplicateToken()
# du.jmsf_duplicate_commit_token()
# print(du.jmsf_duplicate_commit_token())