fix(发布与账号): 修复虚拟铺货和删除任务体验
- 虚拟商品发布跳过地址查询与地址字段,避免被默认地址校验拦截。 - 取消批量铺货后保留上传图片,支持失败项重试并按过期策略清理。 - 优化账号删除的确认弹窗、进度反馈与后台停止逻辑,避免误删和页面卡顿。
This commit is contained in:
1 parent
7fd11106af
commit
fd30a0d17a
14 files changed
+278
-57
No files matched your search
@@ -280,6 +280,33 @@ func TestCancelItemPublishBatchNotFound(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCancelPreviewBatchRetainsUploadDirectoryForRetry(t *testing.T) {
|
||||
srv, store, cleanup := newTestServer(t)
|
||||
defer cleanup()
|
||||
h := srv.Router()
|
||||
cookie := loginHelper(t, h)
|
||||
batchID := previewPublishBatch(t, h, cookie)
|
||||
batch, err := store.PublishBatches.Get(context.Background(), 1, batchID)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
req := httptest.NewRequest(http.MethodPost, "/items/publish-batches/"+batchID+"/cancel", nil)
|
||||
req.AddCookie(cookie)
|
||||
rec := httptest.NewRecorder()
|
||||
h.ServeHTTP(rec, req)
|
||||
if rec.Code != http.StatusOK {
|
||||
t.Fatalf("cancel status=%d body=%s", rec.Code, rec.Body.String())
|
||||
}
|
||||
if _, err := os.Stat(batch.UploadDir); err != nil {
|
||||
t.Fatalf("取消后应保留上传目录供重试: %v", err)
|
||||
}
|
||||
retained, err := store.PublishBatches.Get(context.Background(), 1, batchID)
|
||||
if err != nil || retained.UploadDir != batch.UploadDir {
|
||||
t.Fatalf("取消后应保留 upload_dir: batch=%+v err=%v", retained, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeletePreviewBatchRemovesUploadDirectory(t *testing.T) {
|
||||
srv, store, cleanup := newTestServer(t)
|
||||
defer cleanup()
|
||||
|
||||
Reference in new issue
Block a user