||wan参数细分,修复使用||wan时立即检测一次实际不生效,修复v1第三方备用通知可能无效,调整验证码获取

This commit is contained in:
ramen
2025-01-22 10:55:36 +08:00
parent b0b9c45547
commit f096039b1b
3 changed files with 23 additions and 15 deletions

View File

@@ -143,12 +143,12 @@ class MySender:
返回非 WeChat 通道及其对应 token 的列表
:return: [(channel, token), ...]
"""
return [(channel, token) for channel, token in zip(self.channels, self.tokens) if channel != "WeChat"]
return [(channel, token) for channel, token in zip(self.channels, self.tokens) if channel.lower() != "wechat"]
@staticmethod
def _detect_channel(token):
"""根据 token 确定通知渠道"""
if "WeChat" in token:
if "WeChat" in token or "wechat" in token:
return "WeChat"
letters_only = ''.join(re.findall(r'[A-Za-z]', token))
@@ -214,7 +214,7 @@ class MySender:
else:
send_status = wechat.send_msg(title=title, text=content, userid=actual_userid)
if send_status is None:
if not send_status:
return "微信通知发送错误"
return None