fix(consignment): 兼容旧配置缺少 internalMatch 并刷新配置缓存

- toFormValues/buildPayload 对 internalMatch 使用可选链,避免旧配置或旧缓存导致页面崩溃

- admin-consignment-profiles 查询增加 staleTime: 0,后台配置页每次进入重拉

- 补充前端回归断言
This commit is contained in:
2026-11-10 12:44:35 +08:00
parent 87658a59b1
commit a8c58feebc
2 changed files with 14 additions and 4 deletions
@@ -44,6 +44,13 @@ test('寄卖配置面板:必须覆盖保证金/服务费/数量限制/匹配/
}
})
test('寄卖配置:旧配置缺少 internalMatch 时不能崩溃', () => {
const panel = read('../src/pages/admin/panels/ConsignmentConfigPanel.tsx')
assert.ok(panel.includes('config.internalMatch?.delayMinutes'), '读取旧配置必须使用可选链')
assert.ok(panel.includes('values.internalMatch?.delayMinutes'), '保存旧配置必须使用可选链')
assert.ok(panel.includes('staleTime: 0'), '配置查询必须每次重拉,避免旧缓存缺字段')
})
test('打手端:寄卖页必须按已发布配置动态生成 tab,并支持改价', () => {
const page = read('../src/pages/worker/WorkerConsignmentPage.tsx')
assert.ok(page.includes('fetchWorkerConsignmentProfiles'), '必须拉取已发布寄卖配置')