Skip to content

Commit

Permalink
feat: 获取cookie时,优先后面添加的
Browse files Browse the repository at this point in the history
  • Loading branch information
fzls committed Jan 10, 2024
1 parent fa4a9df commit 47f0097
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qq_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,8 @@ def add_cookie(self, new_name, cookie):
logger.warning(f"{self.name} add_cookie {cookie['domain']} {cookie['name']} {cookie['value']}")

def get_cookie(self, name):
for cookie in self.cookies:
# 这里倒着遍历,从而优先获取后添加进去的
for cookie in reversed(self.cookies):
if cookie["name"] == name and cookie["value"] != "":
return cookie["value"]
return ""
Expand Down

0 comments on commit 47f0097

Please sign in to comment.