Files
online_sys/frontend_智能制造/check_data_integrity.cjs
KQL a7242f0c69 Initial commit: 教务系统在线平台
- 包含4个产业方向的前端项目:智能开发、智能制造、大健康、财经商贸
- 已清理node_modules、.yoyo等大文件,项目大小从2.6GB优化至631MB
- 配置完善的.gitignore文件

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 18:16:55 +08:00

64 lines
2.1 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const fs = require('fs');
// 读取文件
const content = fs.readFileSync('src/mocks/resumeInterviewMock.js', 'utf8');
// 使用eval来执行JS代码仅用于调试
try {
// 移除export语句
const cleanContent = content
.replace(/export\s+function/g, 'function')
.replace(/export\s+const/g, 'const')
.replace(/export\s+\{[^}]+\};?/g, '');
// 执行代码
eval(cleanContent);
// 检查数据
console.log('=== 数据完整性检查 ===\n');
console.log('Industries数量:', industries.length);
console.log('ResumeTemplates键数量:', Object.keys(resumeTemplates).length);
console.log('\n=== Industries列表 ===');
industries.forEach(ind => {
console.log(`- ${ind.name} (${ind.positions.length}个岗位, ${ind.questions.length}个面试题组)`);
});
console.log('\n=== ResumeTemplates键列表 ===');
Object.keys(resumeTemplates).forEach(key => {
const templates = resumeTemplates[key];
console.log(`- ${key}: ${templates.length}个模板`);
});
console.log('\n=== 数据匹配检查 ===');
industries.forEach(ind => {
const hasTemplate = resumeTemplates.hasOwnProperty(ind.name);
if (!hasTemplate) {
console.log(`${ind.name} 没有对应的resumeTemplates`);
} else {
console.log(`${ind.name}${resumeTemplates[ind.name].length} 个简历模板`);
}
});
console.log('\n=== 简历模板数据结构检查 ===');
Object.keys(resumeTemplates).forEach(key => {
const templates = resumeTemplates[key];
templates.forEach((template, idx) => {
const hasContent = !!template.content;
const hasOriginal = !!template.content?.original;
const hasModified = !!template.content?.modified;
const hasStudentInfo = !!template.studentInfo;
if (!hasContent) {
console.log(`${key}[${idx}] (${template.position}) 缺少content字段`);
} else if (!hasOriginal || !hasModified) {
console.log(`⚠️ ${key}[${idx}] (${template.position}) content缺少original或modified`);
}
});
});
} catch (error) {
console.error('执行错误:', error.message);
console.error('错误位置:', error.stack);
}