Skip to content

Commit

Permalink
fix: yema
Browse files Browse the repository at this point in the history
  • Loading branch information
linyuan0213 committed Dec 16, 2024
1 parent 4571120 commit dde8816
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
21 changes: 16 additions & 5 deletions app/plugins/modules/_autosignin/yemapt.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,27 @@ def signin(self, site_info: dict):
cookies=site_cookie
)
# 签到
if "注册新用户" in html_text:
if "注册新用户" not in html_text:
html_text = chrome.get_page_html(url="https://www.yemapt.org/#/consumer/checkIn",
cookies=site_cookie,
click_xpath='xpath://li[contains(@data-menu-id, "/consumer/checkIn")]'
)
if "已签到" in html_text:
self.info("今日已签到")
return True, f'【{site}】今日已签到'

html_text = chrome.get_page_html(url="https://www.yemapt.org/#/consumer/checkIn",
cookies=site_cookie,
click_xpath='xpath://span[@class="ant-statistic-content-suffix"]'
)
# 签到成功
if "已签到" in html_text:
self.info("签到成功")
return True, f'【{site}】签到成功'
else:
self.error("签到失败,签到接口请求失败")
return False, f'【{site}】签到失败,cookie失效'

# 签到成功
if "已签到" in html_text:
self.info("签到成功")
return True, f'【{site}】签到成功'
else:
self.info(f"{site} 开始签到")
html_res = RequestUtils(cookies=site_cookie,
Expand Down
2 changes: 1 addition & 1 deletion web/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@ async def upload():

@App.route('/ical')
@require_auth(force=False)
async def ical():
def ical():
# 是否设置提醒开关
remind = request.args.get("remind")
cal = Calendar()
Expand Down

0 comments on commit dde8816

Please sign in to comment.