同步 Gitee 应用代码更新

This commit is contained in:
super
2026-05-29 19:47:23 +08:00
parent 266c0f17c1
commit 080625567b
7 changed files with 103 additions and 34 deletions

View File

@@ -308,8 +308,9 @@ class AmzoneApprove(AmamzonBase):
self.log("开始执行...")
num = 0
retry_num = 0
max_retry_num = 5
total_page = 0
current_page = 0
while retry_num < max_retry_num: # 最多重试3次
# if num > 3: #测试
# return
@@ -325,13 +326,13 @@ class AmzoneApprove(AmamzonBase):
page_pamel = self.tab.eles('xpath://kat-pagination',timeout=5)
if len(page_pamel) > 0:
current_page = page_pamel[0].sr('xpath:.//ul[@class="pages"]//li[@aria-current="true"]').text
current_page = int(current_page.strip())
# 总页数
total_page = page_pamel[0].sr.eles('xpath:.//ul[@class="pages"]//span[@class="page__inner"][last()]')
if len(total_page) > 0:
total_page = total_page[-1].text
else:
total_page = 0
total_page = int(total_page[-1].text.strip())
self.log(f"当前页码: {current_page} / 总页数: {total_page}")
except Exception as e:
self.log(f"获取页码失败:{e}")
@@ -543,6 +544,14 @@ class AmzoneApprove(AmamzonBase):
self.tab.refresh()
self.tab.wait.doc_loaded(raise_err=False,timeout=120)
#检查页数是否相等,不相等则继续
self.log(f"开始检查页数,当前页数 {current_page} / {total_page}")
if total_page != 0 and current_page!= 0 and current_page < total_page:
self.log(f"检查到页数还未完成,重启浏览器继续")
raise RuntimeError(f"与页面的连接已断开,检查到页数还未完成,重启浏览器继续")
class ApproveTask(TaskBase):
"""审批任务处理类:负责处理产品风险审批任务"""
task_name = "产品风险审批-TASK"