41 lines
1.9 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
pwsh -File scripts\company-alipay-direct\setup-account.ps1
```
按提示在本机输入支付宝账号、密码和财务台账账户简称。默认简称为“朱俊祥支付宝”。密码使用 Windows 当前用户 DPAPI 加密保存到 `runtime/private/alipay-account.dpapi`,不会进入 Git 或日志。
设置完成后脚本会打开独立 Edge 登录窗口,从支付宝商家平台进入资金流水页面并预填账号。图形验证码、短信或扫码确认必须由本人完成;登录成功并进入资金流水页面后会保留浏览器配置目录,后续定时任务复用登录会话。
以后登录失效时,只需重新运行:
```powershell
pwsh -File scripts\company-alipay-direct\open-login.ps1
```
## 手动运行
```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`,业务错误记录在日期日志中。
账单导入生产时统一通过服务器受限批处理入口执行,使用独立批处理容器、上游同步锁和资源上限;支付宝登录与账单导出仍只在本机运行。