修 aliChoice 批量脚本变量遮蔽崩溃(const t 撞任务循环变量,8 条挂 ReferenceError)
This commit is contained in:
1 parent
ad9b955d95
commit
00201b6925
2 files changed
+61
-3
No files matched your search
@@ -140,9 +140,9 @@ for (const t of tasks) {
|
||||
if (attrs !== 'none') log(` 必填属性: ${String(attrs).slice(0, 150)}`);
|
||||
await wait(1200);
|
||||
// 文本型必填(aliChoice 的「材质(Material)」是 input,不是 select):按标题里的材质词兜底
|
||||
const t = String(it.title || '');
|
||||
const matHit = t.match(/plastic|cotton|polyester|stainless steel|metal|silicone|wood|resin|aluminum|alloy|fabric|nylon|glass|ceramic|leather/i);
|
||||
const colorHit = t.match(/black|white|pink|red|blue|green|beige|grey|gray|purple|yellow|brown|khaki|ivory|apricot|silver|gold|multicolou?r/i);
|
||||
const ttl = String(it.title || '');
|
||||
const matHit = ttl.match(/plastic|cotton|polyester|stainless steel|metal|silicone|wood|resin|aluminum|alloy|fabric|nylon|glass|ceramic|leather/i);
|
||||
const colorHit = ttl.match(/black|white|pink|red|blue|green|beige|grey|gray|purple|yellow|brown|khaki|ivory|apricot|silver|gold|multicolou?r/i);
|
||||
// 按字段名给值:颜色别串成材质(曾把「颜色」填成 Resin)
|
||||
const valueFor = (name) => {
|
||||
if (/颜色|Color/i.test(name)) return colorHit ? colorHit[0] : 'Multicolor';
|
||||
|
||||
Reference in new issue
Block a user