Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
doudian-py
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiquan
doudian-py
Commits
682e20a2
Commit
682e20a2
authored
Jun 25, 2025
by
baiquan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移除设置token
parent
3281a0ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
21 deletions
+0
-21
service/page_login.py
+0
-21
No files found.
service/page_login.py
View file @
682e20a2
...
...
@@ -97,27 +97,6 @@ async def page_login(browser_id):
break
except
Exception
as
e
:
logger
.
error
(
f
"{browser_id}-->{e}"
)
tab
.
wait
(
10
)
# 使用正则提取 token
token_pattern
=
r'"token":\s*"([a-f0-9]{32})"'
token_match
=
re
.
search
(
token_pattern
,
tab
.
html
)
if
token_match
:
token
=
token_match
.
group
(
1
)
# 设置 30 天后过期
expires
=
(
datetime
.
now
()
+
timedelta
(
days
=
30
))
.
strftime
(
"
%
a,
%
d
%
b
%
Y
%
H:
%
M:
%
S GMT"
)
cookies
=
(
f
'_shop_token_={token}; '
'path=/; '
'domain=.fxg.jinritemai.com; '
f
'expires={expires}; '
# 指定过期时间
'Secure; '
# 仅 HTTPS 传输
'HttpOnly'
# 禁止 JS 访问
)
tab
.
set
.
cookies
(
cookies
)
else
:
raise
AppError
(
"未找到 token"
)
tab
.
close
()
...
...
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