主要内容: - 包含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>
59 lines
2.4 KiB
Python
59 lines
2.4 KiB
Python
#!/usr/bin/env python3
|
||
# -*- coding: utf-8 -*-
|
||
|
||
import json
|
||
import re
|
||
|
||
def update_avatars_for_two():
|
||
"""更换吕明轩和葛荣景的头像"""
|
||
|
||
# 定义新的头像映射 - 选择不同的头像
|
||
new_avatars = {
|
||
"吕明轩": "https://ddcz-1315997005.cos.ap-nanjing.myqcloud.com/static/avatar/douyin/f7488aa00d87b89bf4749abeb527841d.jpg", # 第3名 - 换另一个新头像
|
||
"葛荣景": "https://ddcz-1315997005.cos.ap-nanjing.myqcloud.com/static/avatar/douyin/591b44d1cb5665e918ded7403c98a056.jpg" # 第4名葛荣景 - 换另一个新头像
|
||
}
|
||
|
||
# 1. 更新 mockData.js 中的 profileOverview 数据
|
||
print("1. 更新 mockData.js 中的头像...")
|
||
with open('src/data/mockData.js', 'r', encoding='utf-8') as f:
|
||
content = f.read()
|
||
|
||
# 更新葛荣景的个人信息头像(studentInfo部分)
|
||
pattern = r'("name": "葛荣景",\s+"realName": "葛荣景",\s+"studentId": "2325060773",\s+"studentNo": "2325060773",\s+"avatar": ")[^"]+(")'
|
||
content = re.sub(pattern, r'\1' + new_avatars["葛荣景"] + r'\2', content)
|
||
|
||
# 更新排名列表中的头像
|
||
for name, avatar_url in new_avatars.items():
|
||
# 更新排名数据中的头像
|
||
pattern = f'("studentName": "{name}",\s+"name": "{name}",\s+"avatar": ")[^"]+(")'
|
||
content = re.sub(pattern, r'\1' + avatar_url + r'\2', content)
|
||
|
||
with open('src/data/mockData.js', 'w', encoding='utf-8') as f:
|
||
f.write(content)
|
||
|
||
print("✅ mockData.js 更新完成")
|
||
|
||
# 2. 更新 ClassRankModal 组件中的头像映射
|
||
print("\n2. 更新 ClassRankModal 组件中的头像映射...")
|
||
with open('src/components/ClassRankModal/index.jsx', 'r', encoding='utf-8') as f:
|
||
content = f.read()
|
||
|
||
# 更新 switch case 中的头像URL
|
||
for name, avatar_url in new_avatars.items():
|
||
pattern = f'case "{name}":\s+avatarUrl = "[^"]+";'
|
||
replacement = f'case "{name}":\n avatarUrl = "{avatar_url}";'
|
||
content = re.sub(pattern, replacement, content)
|
||
|
||
with open('src/components/ClassRankModal/index.jsx', 'w', encoding='utf-8') as f:
|
||
f.write(content)
|
||
|
||
print("✅ ClassRankModal 组件更新完成")
|
||
|
||
print("\n📋 已更换的头像:")
|
||
for name, url in new_avatars.items():
|
||
print(f" - {name}: 已更换为新头像")
|
||
|
||
print("\n✨ 头像更新完成!")
|
||
|
||
if __name__ == "__main__":
|
||
update_avatars_for_two() |