Files
ALL-teach_sys/frontend_环保/fix_resume_structure.py
KQL cd2e307402 初始化12个产业教务系统项目
主要内容:
- 包含12个产业的完整教务系统前端代码
- 智能启动脚本 (start-industry.sh)
- 可视化产业导航页面 (index.html)
- 项目文档 (README.md)

优化内容:
- 删除所有node_modules和.yoyo文件夹,从7.5GB减少到2.7GB
- 添加.gitignore文件避免上传不必要的文件
- 自动依赖管理和智能启动系统

产业列表:
1. 文旅产业 (5150)
2. 智能制造 (5151)
3. 智能开发 (5152)
4. 财经商贸 (5153)
5. 视觉设计 (5154)
6. 交通物流 (5155)
7. 大健康 (5156)
8. 土木水利 (5157)
9. 食品产业 (5158)
10. 化工产业 (5159)
11. 能源产业 (5160)
12. 环保产业 (5161)

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 14:14:14 +08:00

50 lines
1.7 KiB
Python
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.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
# 读取文件
with open('src/mocks/resumeInterviewMock.js', 'r', encoding='utf-8') as f:
content = f.read()
# 查找有问题的结构:在 ], 后面直接跟着 compound_skills: [
# 这种结构破坏了JSON格式需要删除
pattern = r'(\s*\]\s*,)\s*compound_skills:\s*\[[^\]]*?\],\s*personal_summary:\s*"[^"]*?"\s*\}\s*\}\s*\],\s*("(?:新媒体运营|文旅产品设计|品牌运营|旅游)":\s*\[)'
def fix_structure(match):
# 保留第一个 ], 和后面正确的行业开始
return match.group(1) + '\n ' + match.group(2)
# 使用更精确的模式
# 匹配露营地运营后面的多余部分
pattern1 = r'( \}\s*\}\s*\],)\s*compound_skills:\s*\[[^\]]*?\],\s*personal_summary:\s*"[^"]*?"\s*\}\s*\}\s*\],\s*("新媒体运营":\s*\[)'
content = re.sub(pattern1, r'\1\n \2', content)
# 查找并修复其他类似的问题
# 匹配任何在 }] 后面跟着 compound_skills 的情况
pattern2 = r'(\}\s*\]\s*,)\s*compound_skills:\s*\[[^\[]*?\],\s*(?="[^"]+":)'
count = 0
while True:
new_content = re.sub(pattern2, r'\1\n ', content)
if new_content == content:
break
content = new_content
count += 1
print(f"修复了第 {count} 处问题")
# 写回文件
with open('src/mocks/resumeInterviewMock.js', 'w', encoding='utf-8') as f:
f.write(content)
print(f"✅ 修复完成,共修复了 {count} 处结构问题")
# 验证文件语法
import subprocess
result = subprocess.run(['node', '-c', 'src/mocks/resumeInterviewMock.js'],
capture_output=True, text=True)
if result.returncode == 0:
print("✅ 文件语法验证通过")
else:
print(f"❌ 文件仍有语法错误:\n{result.stderr}")