...
|
...
|
@@ -18,6 +18,23 @@ def teardown_hook_get_accesstoken(response): |
|
|
print('写入失败', e)
|
|
|
return access_token
|
|
|
|
|
|
|
|
|
def teardown_hook_get_m_accesstoken(response):
|
|
|
print(response.status_code)
|
|
|
if response.status_code == 200:
|
|
|
jsondata = json.loads(response.text)
|
|
|
access_token = jsondata['data']['access']['accessToken']
|
|
|
try:
|
|
|
# 保存token到文件
|
|
|
with open('config/m_accessToken.csv','w+') as f:
|
|
|
f.write(access_token)
|
|
|
print('写入成功,access_token:{}'.format(access_token))
|
|
|
f.close()
|
|
|
except Exception as e:
|
|
|
print('写入失败', e)
|
|
|
return access_token
|
|
|
|
|
|
|
|
|
def teardown_hook_get_refreshtoken(response):
|
|
|
if response.status_code == 200:
|
|
|
jsondata = json.loads(response.text)
|
...
|
...
|
@@ -32,6 +49,7 @@ def teardown_hook_get_refreshtoken(response): |
|
|
print('写入失败', e)
|
|
|
return refresh_token
|
|
|
|
|
|
|
|
|
def teardown_hook_get_m_refreshtoken(response):
|
|
|
if response.status_code == 200:
|
|
|
jsondata = json.loads(response.text)
|
...
|
...
|
@@ -46,6 +64,7 @@ def teardown_hook_get_m_refreshtoken(response): |
|
|
print('写入失败', e)
|
|
|
return m_refresh_token
|
|
|
|
|
|
|
|
|
def teardown_hook_get_authcode(response):
|
|
|
if response.status_code == 200:
|
|
|
jsondata = json.loads(response.text)
|
...
|
...
|
@@ -60,20 +79,6 @@ def teardown_hook_get_authcode(response): |
|
|
print('写入失败', e)
|
|
|
return authCode
|
|
|
|
|
|
def teardown_hook_get_m_accesstoken(response):
|
|
|
print(response.status_code)
|
|
|
if response.status_code == 200:
|
|
|
jsondata = json.loads(response.text)
|
|
|
access_token = jsondata['data']['access']['accessToken']
|
|
|
try:
|
|
|
# 保存token到文件
|
|
|
with open('config/m_accessToken.csv','w+') as f:
|
|
|
f.write(access_token)
|
|
|
print('写入成功,access_token:{}'.format(access_token))
|
|
|
f.close()
|
|
|
except Exception as e:
|
|
|
print('写入失败', e)
|
|
|
return access_token
|
|
|
|
|
|
def get_accesstoken():
|
|
|
try:
|
...
|
...
|
@@ -86,6 +91,7 @@ def get_accesstoken(): |
|
|
accseetoken_value = str(accseetoken_value)
|
|
|
return accseetoken_value
|
|
|
|
|
|
|
|
|
def get_m_accesstoken():
|
|
|
try:
|
|
|
with open('config/m_accessToken.csv','r') as f:
|
...
|
...
|
@@ -98,6 +104,7 @@ def get_m_accesstoken(): |
|
|
authorization = 'bearer ' + accseetoken_value
|
|
|
return authorization
|
|
|
|
|
|
|
|
|
def get_m_refreshtoken():
|
|
|
try:
|
|
|
with open('config/m_refresh_token.csv','r') as f:
|
...
|
...
|
@@ -110,6 +117,7 @@ def get_m_refreshtoken(): |
|
|
authorization = 'bear ' + m_refreshtoken_value
|
|
|
return authorization
|
|
|
|
|
|
|
|
|
def get_refreshtoken():
|
|
|
try:
|
|
|
with open('config/refreshToken.csv','r') as f:
|
...
|
...
|
@@ -121,6 +129,7 @@ def get_refreshtoken(): |
|
|
refreshtoken_value = str(refreshtoken_value)
|
|
|
return refreshtoken_value
|
|
|
|
|
|
|
|
|
def get_authcode():
|
|
|
try:
|
|
|
with open('config/authCode.csv','r') as f:
|
...
|
...
|
|