feat: 对齐闲鱼续期流程并完善业务管理

对齐官方 WebSocket 批量握手、注册、心跳、ACK、同步恢复及运行时设备标识生命周期。

保留 Cookie 完整属性,接入静默续期和保存登录信息设置,并在凭证更新后重建账号连接。

完善订单与商品同步、卡券和通知渠道交互,更新前端品牌、时间展示及嵌入资源。

补充 Go 与前端回归测试,确保完整检查和生产构建通过。
This commit is contained in:
Christ committed 2026-07-22 12:51:52 +08:00
1 parent 3cc1d4094d
commit d77c317452
69 files changed
+3169 -819

No files matched your search

+21
View File
@@ -122,6 +122,27 @@ func TestPreviewItemPublishBatchNoFile(t *testing.T) {
}
}
func TestPreviewItemPublishBatchRequiresDefaultAccount(t *testing.T) {
srv, _, cleanup := newTestServer(t)
defer cleanup()
h := srv.Router()
cookie := loginHelper(t, h)
var buf bytes.Buffer
mw := multipart.NewWriter(&buf)
file, _ := mw.CreateFormFile("file", "products.csv")
file.Write([]byte("标题,价格,图片\n商品A,12.50,https://example.com/a.png\n"))
_ = mw.Close()
req := httptest.NewRequest(http.MethodPost, "/items/publish-batches/preview", &buf)
req.Header.Set("Content-Type", mw.FormDataContentType())
req.AddCookie(cookie)
rec := httptest.NewRecorder()
h.ServeHTTP(rec, req)
if rec.Code != http.StatusBadRequest || !strings.Contains(rec.Body.String(), "请选择默认发布账号") {
t.Fatalf("status=%d body=%s", rec.Code, rec.Body.String())
}
}
// TestPreviewItemPublishBatchBadDefaultCookie 默认账号不属于当前用户 403。
func TestPreviewItemPublishBatchBadDefaultCookie(t *testing.T) {
srv, _, cleanup := newTestServer(t)