"git@172.16.40.31:zhanhuasheng/willdesk_apiauto.git" did not exist on "f11a98e5de1e7b7bb4da5004e4d80684c6c72885"
Commit 21fc9e89 authored by zhanhuasheng's avatar zhanhuasheng

bugfix

parent b60ac863
...@@ -74,7 +74,7 @@ def customer_login(): ...@@ -74,7 +74,7 @@ def customer_login():
version_url = 'https://allplatformtest.sealapps.com/api/v1/shop/local/getCustomerHtmlLinks?customerDomain=https://utest.sealapps.com&shopDomain=zhs-test.myshopify.com' if env == 'test' else 'https://api.willdesk.com/api/v1/shop/local/getCustomerHtmlLinks?customerDomain=https://u.willdesk.com&shopDomain=test-2023013104.myshopify.com' version_url = 'https://allplatformtest.sealapps.com/api/v1/shop/local/getCustomerHtmlLinks?customerDomain=https://utest.sealapps.com&shopDomain=zhs-test.myshopify.com' if env == 'test' else 'https://api.willdesk.com/api/v1/shop/local/getCustomerHtmlLinks?customerDomain=https://u.willdesk.com&shopDomain=test-2023013104.myshopify.com'
shop_url = 'https://allplatformtest.sealapps.com/api/v1/setting/getCShopSetting?domain=zhs-test.myshopify.com' if env == 'test' else 'https://api.willdesk.com/api/v1/setting/getCShopSetting?domain=test-2023013104.myshopify.com' shop_url = 'https://allplatformtest.sealapps.com/api/v1/setting/getCShopSetting?domain=zhs-test.myshopify.com' if env == 'test' else 'https://api.willdesk.com/api/v1/setting/getCShopSetting?domain=test-2023013104.myshopify.com'
version_res = session.get(url=version_url,headers=headers).text version_res = session.get(url=version_url,headers=headers).text
c_token = re.findall(r'utest.sealapps.com/(.*?)/assets',version_res)[0] customer_v = re.findall(r'utest.sealapps.com/(.*?)/assets',version_res)[0]
shop_res = session.get(url=shop_url,headers=headers).json() shop_res = session.get(url=shop_url,headers=headers).json()
login_url = f'{config_handler.base_config.get_value("url",address)}/api/v1/customer/login' #登录的api login_url = f'{config_handler.base_config.get_value("url",address)}/api/v1/customer/login' #登录的api
data = { data = {
...@@ -85,10 +85,11 @@ def customer_login(): ...@@ -85,10 +85,11 @@ def customer_login():
'shopId' : shop_res['data']['shopInfo']['shopId'], 'shopId' : shop_res['data']['shopInfo']['shopId'],
'timeZone' : '8', 'timeZone' : '8',
'userName' : 'autotest_customer', 'userName' : 'autotest_customer',
'v' : c_token 'v' : customer_v
} }
setattr(global_variate.Global,'customer_v',customer_v)
login_res = session.post(url=login_url,json=data,headers=headers).json() login_res = session.post(url=login_url,json=data,headers=headers).json()
setattr(global_variate.Global,'clientToken',login_res['data']['accessToken']) setattr(global_variate.Global,'customerToken',login_res['data']['accessToken'])
setattr(global_variate.Global,'customerId',login_res['data']['customerId']) setattr(global_variate.Global,'customerId',login_res['data']['customerId'])
setattr(global_variate.Global,'customerName',login_res['data']['name']) setattr(global_variate.Global,'customerName',login_res['data']['name'])
address = 'wss://atestws.sealapps.com/ws' if env == 'test' else 'wss://ws.willdesk.com/ws' address = 'wss://atestws.sealapps.com/ws' if env == 'test' else 'wss://ws.willdesk.com/ws'
...@@ -98,7 +99,7 @@ def customer_login(): ...@@ -98,7 +99,7 @@ def customer_login():
url=f'{address}?platform=1&authorization={global_variate.Global.access_token}&t={int(time.time())}', url=f'{address}?platform=1&authorization={global_variate.Global.access_token}&t={int(time.time())}',
attr='willdesk') # willdesk账号websocket链接 attr='willdesk') # willdesk账号websocket链接
websocket_handler.ws_client = websocket_handler.ws( websocket_handler.ws_client = websocket_handler.ws(
url=f'{address}?platform=1&authorization={global_variate.Global.clientToken}&t={int(time.time())}', url=f'{address}?platform=1&authorization={global_variate.Global.customerToken}&t={int(time.time())}',
attr='customer') # c端websocket链接 attr='customer') # c端websocket链接
async def close_ws(): async def close_ws():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment