const fs = require('fs'); const html = fs.readFileSync('/data/workspace/index.html', 'utf8'); const checks = []; // 1. 图片清单:8个产品图 + 1 banner + 1 about = 10个链接 const requiredImgs = [ 'Image2609141645365831c6','Image260914164536224cb3','Image260914164537224482', 'Image260914164536255172','Image260914164537208a99','Image260914164536615acd', 'Image260914165529351177','Image26091416453598935b', // 8 products 'Image2609161015191453dd', // banner 'Image260916102745404d3a', // about ]; requiredImgs.forEach(k => { checks.push([`图片 ${k} 被引用`, html.includes(k)]); }); // 2. 无 AI 生成/替换 checks.push(['未使用 placeholder/随机图床', !/placeholder|picsum|via\.placehold|unsplash/i.test(html)]); // 3. 无表单/输入 checks.push(['无
', !/([\s\S]*?)<\/title>/); checks.push(['title 存在且含曲靖', !!titleMatch && titleMatch[1].includes('曲靖') && titleMatch[1].includes('更新时间:2026-09-16 21:28:38')]); checks.push(['keywords 非空且含曲靖', /content="([^"]+)"/.test(html) && html.includes('name="keywords"')]); checks.push(['description 非空且含曲靖', html.includes('云南曲靖铁路配件供应商')]); // 5. 无 ICP checks.push(['无 ICP 备案信息', !/ICP|备案号|beian/i.test(html)]); // 6. 无资质证书模块(未提供素材) checks.push(['未写资质证书模块', !/资质证书/.test(html)]); // 7. 导航项 const navItems = ['首页','产品展示','关于我们','应用场景','合作案例','售后服务','常见问题','城市分站','友情链接']; navItems.forEach(n => checks.push([`导航含「${n}」`, html.includes(`>${n}`)])); // 8. 城市分站 10 个链接 ['cjdgg.yu68999','lvest.szbla','dmmcm.tbtnt','sqtnj.jntfw','jmvfh.zhfmgc', 'ljqwm.51mplg','hfbtu.hgesf','qfqzw.layouwei','phrbo.9c3c','oggli.yyc-ai'].forEach(d => { checks.push([`分站 ${d}`, html.includes(d)]); }); // 9. 友情链接 10 个 ['nkcwi.szbla','fzjvw.wggjl','rucab.yyc-ai','rhfcc.jntfw','octwg.g587', 'tqlds.buhuihua','grmjp.g587','nlhpj.836188','gxpun.layouwei','rswbe.yyc-ai'].forEach(d => { checks.push([`友链 ${d}`, html.includes(d)]); }); // 10. banner 1920x1000 宽高比处理 checks.push(['banner aspect-ratio 1920/1000', html.includes('1920 / 1000')]); // 11. 响应式 viewport checks.push(['viewport 响应式', html.includes('width=device-width')]); let pass = 0, fail = 0; checks.forEach(([name, ok]) => { if(ok){pass++;} else {fail++; console.log(' ✗ 未通过:'+name);} }); console.log(`\n总计:${pass} 通过,${fail} 未通过`); process.exit(fail ? 1 : 0);