release: bump version to 1.1.7, update xq0031_xq0032 plugin to 1.0.8
主要变更: 1. 整体版本升级至1.1.7,更新安装包与shell版本号 2. 新增API与后端能力: - 新增停止运行接口,支持强制终止插件进程与浏览器子进程 - 云端会话令牌与下载票据落库,适配多worker部署 - 优化Chrome版本读取逻辑,避免弹窗与编码问题 3. xq0031_xq0032插件升级至1.0.8: - 新增仓库中文名自动筛选功能,简化用户操作 - 优化ERP登录与报表导出流程,修复标签页残留问题 - 新增前端强制停止按钮,支持实时终止运行 - 修复中文编码与乱码问题,兼容Windows非UTF-8环境 4. 修复授权校验逻辑,确保账号与授权匹配 5. 更新文档与部署脚本,修正发版流程说明
This commit is contained in:
@@ -35,10 +35,12 @@ except OSError:
|
||||
|
||||
|
||||
def _emit(obj: dict) -> None:
|
||||
"""写一行 JSON 到协议通道(原始 stdout)。插件 print 已改道 stderr,不污染协议。"""
|
||||
"""写一行 JSON 到协议通道(原始 stdout.buffer,显式 UTF-8 字节)。
|
||||
插件 print 已改道 stderr,不污染协议;不走文本层是避免 Windows GBK 环境下
|
||||
stdout 按 locale 编码导致中文变 mojibake(父进程按 UTF-8 解码会对不上)。"""
|
||||
try:
|
||||
_PROTO.write(json.dumps(obj, ensure_ascii=False) + "\n")
|
||||
_PROTO.flush()
|
||||
_PROTO.buffer.write((json.dumps(obj, ensure_ascii=False) + "\n").encode("utf-8"))
|
||||
_PROTO.buffer.flush()
|
||||
except Exception: # noqa: BLE001 通道已关则静默
|
||||
pass
|
||||
|
||||
@@ -65,12 +67,14 @@ def _run() -> int:
|
||||
if "--allowed" in sys.argv else "")
|
||||
allowed = {s for s in allowed_arg.split(",") if s} if allowed_arg else None
|
||||
|
||||
# fields 经 stdin 传入(单行 JSON)
|
||||
# fields 经 stdin 传入(单行 JSON,UTF-8 字节):显式走 buffer 按 UTF-8 解,
|
||||
# 不依赖 sys.stdin 的 locale 解码(Windows GBK 环境下中文会被解出乱码/孤立代理字符,
|
||||
# 导致 fields 值与插件内字符串常量比对失败,如「未知执行模式」)
|
||||
fields: dict = {}
|
||||
try:
|
||||
_line = sys.stdin.readline().strip()
|
||||
if _line:
|
||||
fields = json.loads(_line) or {}
|
||||
_raw = sys.stdin.buffer.readline().strip()
|
||||
if _raw:
|
||||
fields = json.loads(_raw) or {}
|
||||
except Exception as _e: # noqa: BLE001
|
||||
fields = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user