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.
45 lines
1.8 KiB
45 lines
1.8 KiB
|
1 week ago
|
// 枚举 data.js 的候选 URL 形状
|
||
|
|
import fs from 'node:fs';
|
||
|
|
const data = JSON.parse(fs.readFileSync('e:/code/crm-backend-matt/.scratch/lanhu-latest/axure-v29.json', 'utf8'));
|
||
|
|
const entry = data.pages['a3-1-1-1-8(个人)商机详情_团队成员.html'];
|
||
|
|
const sign = entry.dataJs.sign_md5;
|
||
|
|
const rel = entry.dataJs.src;
|
||
|
|
const htmlSign = entry.html.sign_md5;
|
||
|
|
const htmlRel = entry.html.src;
|
||
|
|
|
||
|
|
const DOC_ID = 'bade4454-52aa-44db-8ba2-dec594732ecb';
|
||
|
|
const VER = 'c461813e-2c49-4bcc-8602-babcaf14c3bb';
|
||
|
|
const PID = 'e528bb49-1eea-4d76-b7e0-4055bc7c1b70';
|
||
|
|
const TID = 'b013dded-642f-4899-b829-daa5c093fdf0';
|
||
|
|
|
||
|
|
const enc = encodeURIComponent(rel);
|
||
|
|
const candidates = [
|
||
|
|
`https://lanhu-axure-file.oss-cn-beijing.aliyuncs.com/${sign}`,
|
||
|
|
`https://axure-file.lanhuapp.com/${sign}`,
|
||
|
|
`https://lanhu-axure-file.oss-cn-beijing.aliyuncs.com/${enc}`,
|
||
|
|
`https://axure-file.lanhuapp.com/${enc}`,
|
||
|
|
`https://axure-file.lanhuapp.com/${DOC_ID}/${enc}`,
|
||
|
|
`https://axure-file.lanhuapp.com/${DOC_ID}/${VER}/${enc}`,
|
||
|
|
`https://axure-file.lanhuapp.com/${VER}/${enc}`,
|
||
|
|
`https://axure-file.lanhuapp.com/${DOC_ID}/${VER}/${sign}`,
|
||
|
|
`https://axure-file.lanhuapp.com/${TID}/${DOC_ID}/${VER}/${enc}`,
|
||
|
|
// mapping_md5 候选
|
||
|
|
`https://lanhu-axure-file.oss-cn-beijing.aliyuncs.com/${entry.mapping_md5}`,
|
||
|
|
`https://axure-file.lanhuapp.com/${entry.mapping_md5}`,
|
||
|
|
];
|
||
|
|
|
||
|
|
for (const url of candidates) {
|
||
|
|
try {
|
||
|
|
const res = await fetch(url, { headers: { 'User-Agent': 'Mozilla/5.0' }, method: 'GET' });
|
||
|
|
const ct = res.headers.get('content-type') || '';
|
||
|
|
let head = '';
|
||
|
|
if (res.ok) {
|
||
|
|
const t = await res.text();
|
||
|
|
head = `| len=${t.length} | head=${t.slice(0, 120).replace(/\n/g, ' ')}`;
|
||
|
|
}
|
||
|
|
console.log(`${res.status} ${ct.slice(0, 30).padEnd(30)} ${url.slice(0, 110)} ${head}`);
|
||
|
|
} catch (e) {
|
||
|
|
console.log('ERR', url.slice(0, 110), e.message.slice(0, 60));
|
||
|
|
}
|
||
|
|
}
|