Files
ALL-teach_sys/frontend_视觉设计/replaceTeacherToSun.cjs
KQL 38350dca36 更新12个教务系统并优化项目大小
主要更新:
- 更新所有12个产业的教务系统数据和功能
- 删除所有 node_modules 文件夹(节省3.7GB)
- 删除所有 .yoyo 缓存文件夹(节省1.2GB)
- 删除所有 dist 构建文件(节省55MB)

项目优化:
- 项目大小从 8.1GB 减少到 3.2GB(节省60%空间)
- 保留完整的源代码和配置文件
- .gitignore 已配置,防止再次提交大文件

启动脚本:
- start-industry.sh/bat/ps1 脚本会自动检测并安装依赖
- 首次启动时自动运行 npm install
- 支持单个或批量启动产业系统

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-17 14:36:25 +08:00

108 lines
4.3 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.

#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
// 孙悦彤的导师信息
const sunYueTongInfo = {
name: "孙悦彤",
title: "企业资深HR",
avatar: "https://ddcz-1315997005.cos.ap-nanjing.myqcloud.com/static/img/teach_sys_teacher-avatar/recuXM074e1DUq.png",
introduction: "推动集团招聘数字化转型引入ATS与视频面试工具使简历处理效率提升40%关键岗位转化率提高至32%用人部门满意度提升20%。同时主导上线HR SaaS平台和数据分析体系实现人事数据可视化与决策支持。作为资深一线HR导师还长期面向求职者提供一对一的个性化辅导从真实招聘场景出发帮助学员掌握简历优化与筛选逻辑、面试答题技巧与岗位匹配思路并结合职业路径规划提供可落地的发展方案帮助学员快速提升求职竞争力。",
specialties: ["模拟面试实战", "核心能力塑造", "职场沟通提升", "长远目标设定"]
};
console.log('开始替换魏立慧为孙悦彤...\n');
// 1. 更新 mockData.js
const mockDataPath = path.join(__dirname, 'src/data/mockData.js');
console.log('正在更新 mockData.js...');
// 备份
const mockDataBackup = `${mockDataPath}.backup_${new Date().toISOString().replace(/[:.]/g, '-')}`;
fs.copyFileSync(mockDataPath, mockDataBackup);
console.log(`✓ 已备份到: ${mockDataBackup}`);
let mockDataContent = fs.readFileSync(mockDataPath, 'utf-8');
// 替换 teachers 对象中的魏立慧
mockDataContent = mockDataContent.replace(
/:\s*\{[^}]+\}/s,
`孙悦彤: {
name: "孙悦彤",
title: "企业资深HR",
avatar: "${sunYueTongInfo.avatar}"
}`
);
// 替换 jobStrategyLive 中的引用
mockDataContent = mockDataContent.replace(
/teacher:\s*teachers\.魏立慧/g,
'teacher: teachers.孙悦彤'
);
fs.writeFileSync(mockDataPath, mockDataContent);
console.log('✓ mockData.js 更新完成');
// 2. 更新 visualDesignCalendar.json
const calendarPath = path.join(__dirname, 'src/data/visualDesignCalendar.json');
console.log('\n正在更新 visualDesignCalendar.json...');
// 备份
const calendarBackup = `${calendarPath}.backup_${new Date().toISOString().replace(/[:.]/g, '-')}`;
fs.copyFileSync(calendarPath, calendarBackup);
console.log(`✓ 已备份到: ${calendarBackup}`);
let calendarData = JSON.parse(fs.readFileSync(calendarPath, 'utf-8'));
// 替换所有1V1求职规划和面试实战课程的导师
let replacedCount = 0;
// calendarData 是一个数组
calendarData.forEach(item => {
// 检查1V1规划阶段
if (item['1V1 规划阶段'] === '1V1 求职规划' && item['导师姓名查询'] === '魏立慧') {
item['导师姓名查询'] = '孙悦彤';
replacedCount++;
}
// 检查模拟面试实战练习阶段
if (item['模拟面试实战练习阶段'] === '面试实战' && item['导师姓名查询'] === '魏立慧') {
item['导师姓名查询'] = '孙悦彤';
replacedCount++;
}
// 或者直接替换所有魏立慧的导师
if (item['导师姓名查询'] === '魏立慧') {
item['导师姓名查询'] = '孙悦彤';
if (!replacedCount) replacedCount++; // 避免重复计数
}
});
fs.writeFileSync(calendarPath, JSON.stringify(calendarData, null, 2));
console.log(`✓ visualDesignCalendar.json 更新完成,共替换 ${replacedCount}`);
// 3. 验证替换结果
console.log('\n验证替换结果...');
// 检查 mockData.js
const updatedMockData = fs.readFileSync(mockDataPath, 'utf-8');
const weiReferences = (updatedMockData.match(/魏立慧/g) || []).length;
const sunReferences = (updatedMockData.match(/孙悦彤/g) || []).length;
console.log(`mockData.js - 魏立慧: ${weiReferences} 处, 孙悦彤: ${sunReferences}`);
// 检查 calendar
const updatedCalendar = fs.readFileSync(calendarPath, 'utf-8');
const weiInCalendar = (updatedCalendar.match(/魏立慧/g) || []).length;
const sunInCalendar = (updatedCalendar.match(/孙悦彤/g) || []).length;
console.log(`visualDesignCalendar.json - 魏立慧: ${weiInCalendar} 处, 孙悦彤: ${sunInCalendar}`);
if (weiReferences === 0 && weiInCalendar === 0) {
console.log('\n✅ 成功!所有魏立慧的引用已替换为孙悦彤');
} else {
console.log('\n⚠ 警告:仍有魏立慧的引用未被替换');
}
console.log('\n替换完成');