Files
dns-server/debug-json.js
T
Alex Yang f627244b8f 更新
2026-03-30 01:04:46 +08:00

21 lines
632 B
JavaScript

const fs = require('fs');
// 读取文件内容
const content = fs.readFileSync('./static/api/js/index.js', 'utf8');
// 提取swaggerDocument部分
const match = content.match(/const swaggerDocument = (.*?);/s);
if (match) {
const jsonStr = match[1];
console.log('JSON字符串长度:', jsonStr.length);
// 显示错误位置附近的内容
const errorPos = 70599;
const start = Math.max(0, errorPos - 200);
const end = Math.min(jsonStr.length, errorPos + 200);
console.log('错误位置附近的内容:');
console.log(jsonStr.substring(start, end));
} else {
console.log('未找到swaggerDocument定义');
}