配置表数据变化

This commit is contained in:
chen wei bo
2025-09-05 10:56:43 +08:00
parent 76669b4639
commit 5821bc17ae
7 changed files with 11 additions and 10 deletions
+7 -2
View File
@@ -67,11 +67,16 @@ export class GirlData extends BaseData {
let allData = this.parseAllGirlBrief(respOrList);
if (!allData) return;
const bucket = this.ensureBucket(categoryId);
// 用一个临时 Set 保存已有的 id,加速去重
const existed = new Set<number>(bucket.girlIds);
for (const g of allData) {
const id = g.id;
bucket.briefs.set(id, g);
// TODO去重
bucket.girlIds.push(id);
// 去重
if (!existed.has(id)) {
bucket.girlIds.push(id);
existed.add(id);
}
}
console.log("保存技师的简要数据: ", bucket);
}