You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
2.0 KiB
44 lines
2.0 KiB
// 1. 下载 mapping_md5 JSON 看内容
|
|
// 2. 从 network-log-v2.json 找图片加载方式
|
|
import fs from 'node:fs';
|
|
const data = JSON.parse(fs.readFileSync('e:/code/crm-backend-matt/.scratch/lanhu-latest/axure-v29.json', 'utf8'));
|
|
const key = Object.keys(data.pages).find(k => k.includes('a3-1-1-1-8'));
|
|
const entry = data.pages[key];
|
|
|
|
// mapping JSON 候选 URL
|
|
for (const base of ['https://lanhu-axure-file.oss-cn-beijing.aliyuncs.com', 'https://axure-file.lanhuapp.com']) {
|
|
const url = `${base}/${entry.mapping_md5}`;
|
|
try {
|
|
const res = await fetch(url, { headers: { 'User-Agent': 'Mozilla/5.0' } });
|
|
console.log(res.status, url.slice(0, 100));
|
|
if (res.ok) {
|
|
const t = await res.text();
|
|
fs.writeFileSync('e:/code/crm-backend-matt/.scratch/lanhu-latest/team-mapping.json', t, 'utf8');
|
|
console.log('mapping saved, len:', t.length);
|
|
console.log('head 600:', t.slice(0, 600));
|
|
break;
|
|
}
|
|
} catch (e) { console.log('ERR', e.message.slice(0, 80)); }
|
|
}
|
|
|
|
// network log 里的图片请求
|
|
console.log('\n=== network log 中的图片/资源请求 ===');
|
|
try {
|
|
const log = JSON.parse(fs.readFileSync('e:/code/crm-backend-matt/.scratch/lanhu-latest/network-log-v2.json', 'utf8'));
|
|
const arr = Array.isArray(log) ? log : (log.requests || log.entries || []);
|
|
console.log('log entries:', arr.length);
|
|
const seen = new Set();
|
|
for (const e of arr) {
|
|
const u = e.url || (e.request && e.request.url) || '';
|
|
if (!u) continue;
|
|
if (/\.(png|jpg|gif|svg)|\/images\/|sign_md5|axure-file/i.test(u)) {
|
|
const short = u.slice(0, 160);
|
|
if (!seen.has(short)) { seen.add(short); console.log(' ', e.status || (e.response && e.response.status) || '', short); }
|
|
}
|
|
}
|
|
if (!seen.size) {
|
|
// 打印所有 URL 让人眼看
|
|
console.log('(无图片请求,打印全部 URL 样本)');
|
|
for (const e of arr.slice(0, 40)) console.log(' ', (e.url || JSON.stringify(e).slice(0, 120)));
|
|
}
|
|
} catch (e) { console.log('log read ERR:', e.message); }
|
|
|