-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmy_command.py
More file actions
53 lines (43 loc) · 1.75 KB
/
my_command.py
File metadata and controls
53 lines (43 loc) · 1.75 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import requests, json, sys
import argparse
import urllib3
urllib3.disable_warnings()
def _getData(mark):
#print(f"命令参数是: {mark}")
data = {
"companyName": "广州诗尼曼家居股份有限公司",
"sysLoginUrl": "https://gzsm.org.cn/js/a/login",
"gateName": "广州市建设领域管理应用信息平台",
"companyId": 1002352,
"password": "",
"mainContractor": 1,
"projectNo": "2305231750021897734",
#"is_cron": False,
"is_cron_new": True,
"callbackUrl": "https://dev-szjg-api-web.cwdsp.com/v1/craftsman/project/check3rdAccountAndPassword",
"govSysProjectName": "欧昊集团总部大楼地下室及东塔项目",
"gateNo": "ZJ001",
"projectName": "新年分包项目一v1001T8",
"username": "zhonghuohua"
}
#data['is_cron'] = False
if mark == 'restart':
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
url = 'https://dev-szjg-rpa-account.cwdsp.com/restart'
response = requests.post(url, data=json.dumps(data), headers=headers, verify=False)
print(response.content)
sys.exit()
if mark == 'check':
data['is_cron_new'] = False
if mark == 'fetch':
data['is_cron_new'] = True
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
url = 'https://dev-szjg-rpa-account.cwdsp.com/accountVerify'
response = requests.post(url, data=json.dumps(data), headers=headers, verify=False)
print(response.content)
def getData():
parser = argparse.ArgumentParser()
parser.add_argument('arg1', help='first argument')
#parser.add_argument('arg2', help='second argument')
args = parser.parse_args()
_getData(args.arg1)