Files
teach_sys_Demo/count_courses.cjs
KQL 1b964b3886 chore: 更新数据文件和组件优化
主要更新内容:
- 优化UI组件(视频播放器、HR访问模态框、岗位信息展示等)
- 更新数据文件(简历、岗位、项目案例等)
- 添加新的图片资源(面试状态图标等)
- 新增AgentPage等页面组件
- 清理旧的备份文件,提升代码库整洁度
- 优化岗位等级和面试状态的数据结构

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 15:55:25 +08:00

35 lines
1.5 KiB
JavaScript

const fs = require('fs');
const path = require('path');
// 读取mockData.js文件
const mockDataPath = path.join(__dirname, 'src/data/mockData.js');
const mockDataContent = fs.readFileSync(mockDataPath, 'utf-8');
// 提取homework数组中的课程对象
// 匹配 { id: X, name: "xxx", level: "xxx", ... } 格式
const coursePattern = /\{\s*id:\s*\d+,\s*name:\s*"([^"]+)",\s*level:\s*"[^"]+"/g;
let matches = mockDataContent.match(coursePattern);
console.log('mockData.js中找到的课程对象总数:', matches ? matches.length : 0);
// 统计units结构中的courses
const unitsPattern = /units:\s*\[([\s\S]*?)\]\s*,\s*\/\/ 保留原始list用于兼容/g;
const unitsMatches = [...mockDataContent.matchAll(unitsPattern)];
console.log('\n找到的units结构数量:', unitsMatches.length);
let totalCoursesInUnits = 0;
unitsMatches.forEach((match, index) => {
const unitsContent = match[1];
const coursesInThisSection = (unitsContent.match(/\{\s*id:\s*\d+,\s*name:\s*"[^"]+",\s*level:/g) || []).length;
console.log(` - 第${index + 1}个section的units中有 ${coursesInThisSection} 个课程`);
totalCoursesInUnits += coursesInThisSection;
});
console.log('\nunits结构中的课程总数:', totalCoursesInUnits);
// 检查有多少课程已经有imageUrl
const imageUrlPattern = /imageUrl:\s*"https:\/\/[^"]+"/g;
const imageUrlMatches = mockDataContent.match(imageUrlPattern);
console.log('\n已添加imageUrl的课程数:', imageUrlMatches ? imageUrlMatches.length : 0);