92451 e029f92413 fix: 加固支付宝定时任务启动环境 (#799)
增加定时任务宿主入口、错误日志与 Node.js 环境发现。
Co-authored-by: 92451 <924518135@qq.com>
Co-committed-by: 92451 <924518135@qq.com>
2026-10-30 20:21:21 +08:00

33 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 公司非店铺支付宝每日账单
每天 09:45 自动读取公司支付宝账户前一天的交易记录,并导入财务台账“动账明细”。
## 首次登录
```powershell
node scripts\company-alipay-direct\open-login.mjs
```
脚本会打开独立 Edge 登录窗口并预填账号。图形验证码、短信或扫码确认必须由本人完成;登录成功后保留该浏览器配置目录,后续定时任务复用登录会话。
## 手动运行
```powershell
pwsh -File scripts\company-alipay-direct\run-alipay-daily.ps1
# 指定历史日期,只导出不导入
pwsh -File scripts\company-alipay-direct\run-alipay-daily.ps1 -Date 2026-10-29 -DryRun
```
## 安装每日任务
```powershell
pwsh -File scripts\company-alipay-direct\install-daily-task.ps1
```
账号、密码、账户简称和浏览器登录态仅保存在 `runtime/private/`,不会进入 Git。私有文件需包含 `账号:`、`密码:` 和 `支付宝账户简称:` 三项。任一登录失效、验证页面出现、空数据或导入失败都会保留上一版数据并记录日志。
定时任务通过 `run-alipay-daily.cmd` 启动,并优先使用系统 Node.js;若仅在 Codex 运行时可用,会自动使用当前固定运行时路径。任务宿主错误记录在同目录的 `task-host.log`,业务错误记录在日期日志中。
账单导入生产时统一通过服务器受限批处理入口执行,使用独立批处理容器、上游同步锁和资源上限;支付宝登录与账单导出仍只在本机运行。