由 Codex (gpt-5.6-sol) 实施,Claude 审核。MVP2 第一块。 internal/taobao/chrome.go - EnsureBrowser 按四项条件判断能否复用已有实例:PID 存在、进程命令行 属于本程序专属 profile、CDP 端口可访问、存在 page 类型目标 - 启动前遍历整个端口段,发现已有 Chrome 但状态文件丢失时报错而不是 再起一个,避免同一 profile 出现两个实例损坏登录数据 - CloseBrowser 必须先校验 PID 归属才允许 taskkill,防止误杀使用者 自己的 Chrome internal/taobao/cdp.go - 基于 gorilla/websocket 的最小 CDP 客户端(该依赖原本就在模块图里, 由 Wails 引入,此处仅从 indirect 提为直接依赖) - CookieNames 的结构体只声明 Name 和 Domain,Cookie 的值根本不会 进入内存,比"取到但不使用"更彻底 internal/taobao/login.go - 两层判定:四个必需 Cookie 齐全,且我的淘宝页面标题与正文不含 六个阻断词 - 昵称只作展示,不参与判定。这是对参考 Python 实现的一处有意偏离: 参考实现要求解析出昵称才算有效,但该解析依赖淘宝页面文案, 淘宝一改版就会永远解析不到,导致登录永远判为无效、全局停止门 永久触发、工具彻底不可用。放宽的代价可控:误判为已登录时后续 MTOP 请求会失败,那条链路本就有 token 失效处理。 app.go 只在点击按钮时启动 Chrome,startup 不自动启动。 前端:设置页两个按钮接真实方法并显示检查结果;侧栏淘宝状态灯 监听 taobao:status 事件。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LbdtsD3ohhSMy3KPoCgARq
47 lines
1.8 KiB
AMPL
47 lines
1.8 KiB
AMPL
module cmsp
|
|
|
|
go 1.25.0
|
|
|
|
require (
|
|
github.com/gorilla/websocket v1.5.3
|
|
github.com/wailsapp/wails/v2 v2.15.0
|
|
gopkg.in/yaml.v3 v3.0.1
|
|
modernc.org/sqlite v1.57.0
|
|
)
|
|
|
|
require (
|
|
git.sr.ht/~jackmordaunt/go-toast/v2 v2.0.3 // indirect
|
|
github.com/bep/debounce v1.2.1 // indirect
|
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
|
github.com/go-ole/go-ole v1.3.0 // indirect
|
|
github.com/godbus/dbus/v5 v5.1.0 // indirect
|
|
github.com/google/uuid v1.6.0 // indirect
|
|
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
|
|
github.com/labstack/echo/v4 v4.13.3 // indirect
|
|
github.com/labstack/gommon v0.4.2 // indirect
|
|
github.com/leaanthony/go-ansi-parser v1.6.1 // indirect
|
|
github.com/leaanthony/gosod v1.0.4 // indirect
|
|
github.com/leaanthony/slicer v1.6.0 // indirect
|
|
github.com/leaanthony/u v1.1.1 // indirect
|
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
|
github.com/mattn/go-isatty v0.0.24 // indirect
|
|
github.com/ncruces/go-strftime v1.0.0 // indirect
|
|
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
|
|
github.com/pkg/errors v0.9.1 // indirect
|
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
|
github.com/rivo/uniseg v0.4.7 // indirect
|
|
github.com/samber/lo v1.49.1 // indirect
|
|
github.com/tkrajina/go-reflector v0.5.8 // indirect
|
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
|
github.com/valyala/fasttemplate v1.2.2 // indirect
|
|
github.com/wailsapp/go-webview2 v1.0.22 // indirect
|
|
github.com/wailsapp/mimetype v1.4.1 // indirect
|
|
golang.org/x/crypto v0.53.0 // indirect
|
|
golang.org/x/net v0.56.0 // indirect
|
|
golang.org/x/sys v0.47.0 // indirect
|
|
golang.org/x/text v0.39.0 // indirect
|
|
modernc.org/libc v1.74.4 // indirect
|
|
modernc.org/mathutil v1.7.1 // indirect
|
|
modernc.org/memory v1.11.0 // indirect
|
|
)
|