Skip to content

Commit

Permalink
fix:暴力确认抢到
Browse files Browse the repository at this point in the history
  • Loading branch information
Hobr committed Jul 10, 2024
1 parent fa0232f commit 0332044
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ python cli.py

## 开发计划

- [ ] 429
- [ ] 其他票种可购情况
- [ ] 检测配置文件完整性
- [ ] 修改打包模式为目录模式, 而不是单文件模式
Expand Down
8 changes: 5 additions & 3 deletions util/Bilibili/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,9 @@ def CreateOrder(self) -> tuple:
msg = res["msg"]

# 成功
if code == 0:
if "data" in res and "token" in res["data"]:
self.orderToken = res["data"]["token"]
code = 0

return code, msg

Expand All @@ -301,8 +302,9 @@ def CreateOrderStatus(self) -> tuple:
res = self.net.Response(method="get", url=url)
code = res["errno"]

if code == 0:
self.orderId = res["data"]["payParam"]["orderId"]
if "data" in res and "order_id" in res["data"]:
self.orderId = res["data"]["order_id"]
code = 0

return code, res["msg"]

Expand Down
4 changes: 2 additions & 2 deletions util/Task/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def CreateOrderAction(self) -> None:
match self.createOrderCode:
# 成功
case 0:
logger.success("【创建订单】订单创建成功!")
logger.success(f"【创建订单】订单创建成功! {msg}")
self.availableTime = int(time())

# Token过期
Expand Down Expand Up @@ -511,7 +511,7 @@ def CreateStatusAction(self) -> None:
match code:
# 正常
case 0:
logger.success("【创建订单状态】锁单成功!")
logger.success(f"【创建订单状态】锁单成功! {msg}")

self.createStatusCode, msg, self.orderId = self.api.GetOrderStatus()
match self.createStatusCode:
Expand Down

0 comments on commit 0332044

Please sign in to comment.