duplicateToken.py
1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import urllib3
from commons import common as com
from commons.MySession import my,s1
import requests
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"] = s1.cookies["UAP_accessToken"]
self.header["UAP_refreshToken"] = s1.cookies["UAP_refreshToken"]
self.header["UAP_firmId"] = s1.cookies["UAP_firmId"]
self.header["Host"] = com.get_global_config("global_data", "host", "gateway")
def jmsf_duplicate_commit_token(self):
re = s1.get(url=self.url, headers=self.header)
return re.json()["data"]
# print(s1.headers)
# du=duplicateToken()
# print(du.jmsf_duplicate_commit_token())
# print(re.json())
# print(re.headers)