fix(账号状态): 读到什么写什么,读不到不再推断成「正常」
This commit is contained in:
+11
-7
@@ -1282,15 +1282,19 @@ class GenericStepsWorker(BaseWorker):
|
||||
# (「切换账号」和推送前核对都用它 —— 必须同一个控件、同一套清洗)
|
||||
self._vars["name_selector"] = (sel_type, sel_val)
|
||||
# 变量名是 `account_status` → **顺手回写账号库**(资产管理里的「账号状态」列)。
|
||||
# 约定:读到文字就存文字(如「账号异常」);元素不存在 = 没检出异常 → 存「正常」。
|
||||
# 用户口径:"读出来是什么就写入什么" —— 读到文字就原样写;读不到**不写库**
|
||||
# (绝不把"没读到"推断成「正常」,否则会把「作品异常」这类真实状态盖掉)。
|
||||
if var == "account_status":
|
||||
who = self._scope_name()
|
||||
try:
|
||||
from core import account_folder as _af
|
||||
if not _af.set_account_status(who, text or "正常"):
|
||||
_log.warning(f"[{self.serial}] 账号状态未回写:账号库里没有『{who}』")
|
||||
except Exception as e:
|
||||
_log.warning(f"[{self.serial}] 账号状态回写失败(不影响任务): {e}")
|
||||
if text:
|
||||
try:
|
||||
from core import account_folder as _af
|
||||
if not _af.set_account_status(who, text):
|
||||
_log.warning(f"[{self.serial}] 账号状态未回写:账号库里没有『{who}』")
|
||||
except Exception as e:
|
||||
_log.warning(f"[{self.serial}] 账号状态回写失败(不影响任务): {e}")
|
||||
else:
|
||||
_log.info(f"[{self.serial}] 账号状态:没读到 → 不写库(保留原值)")
|
||||
if not text:
|
||||
_log.warning(f"[{self.serial}] 读取文字:读不到(元素原文 {raw!r})→ 变量"
|
||||
f"『{var}』置空")
|
||||
|
||||
Reference in New Issue
Block a user