Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
willdesk_apiauto
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
29
Issues
29
List
Boards
Labels
Service Desk
Milestones
Merge Requests
29
Merge Requests
29
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
桦生 詹
willdesk_apiauto
Commits
21fc9e89
Commit
21fc9e89
authored
Mar 08, 2024
by
zhanhuasheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix
parent
b60ac863
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
conftest.py
conftest.py
+5
-4
No files found.
conftest.py
View file @
21fc9e89
...
@@ -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
]
c
ustomer_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'
:
c
ustomer_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
,
'c
lient
Token'
,
login_res
[
'data'
][
'accessToken'
])
setattr
(
global_variate
.
Global
,
'c
ustomer
Token'
,
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
.
c
lient
Token
}
&t=
{
int
(
time
.
time
())
}
'
,
url
=
f
'
{
address
}
?platform=1&authorization=
{
global_variate
.
Global
.
c
ustomer
Token
}
&t=
{
int
(
time
.
time
())
}
'
,
attr
=
'customer'
)
# c端websocket链接
attr
=
'customer'
)
# c端websocket链接
async
def
close_ws
():
async
def
close_ws
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment