Files
online_sys/frontend_大健康/change_chen_avatar_fifth.py
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

45 lines
1.6 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
# 读取mockData.js文件
with open('src/data/mockData.js', 'r', encoding='utf-8') as f:
content = f.read()
# 陈沐谦的新头像URL选择一个之前没用过的
# 使用: 07a0a14c8c8d5476b2c8d54de12e6a06.jpg (id: 2)
chen_new_avatar = "https://ddcz-1315997005.cos.ap-nanjing.myqcloud.com/static/avatar/douyin/07a0a14c8c8d5476b2c8d54de12e6a06.jpg"
# 当前陈沐谦的头像URL
chen_old_avatar = "https://ddcz-1315997005.cos.ap-nanjing.myqcloud.com/static/avatar/douyin/457cfa8e557879e14d54f13dc226a11e.jpg"
# 替换陈沐谦的所有头像
content = content.replace(chen_old_avatar, chen_new_avatar)
# 写回文件
with open('src/data/mockData.js', 'w', encoding='utf-8') as f:
f.write(content)
print("✅ 已更换mockData.js中陈沐谦的所有头像")
print(f"陈沐谦新头像: 07a0a14c8c8d5476b2c8d54de12e6a06.jpg")
# 同时更新ClassRankModal中的头像映射
modal_file = 'src/components/ClassRankModal/index.jsx'
with open(modal_file, 'r', encoding='utf-8') as f:
modal_content = f.read()
# 替换ClassRankModal中陈沐谦的头像
modal_content = modal_content.replace(chen_old_avatar, chen_new_avatar)
# 写回ClassRankModal文件
with open(modal_file, 'w', encoding='utf-8') as f:
f.write(modal_content)
print("✅ 同时更新了ClassRankModal中的头像映射")
# 统计替换的位置
with open('src/data/mockData.js', 'r', encoding='utf-8') as f:
check_content = f.read()
chen_count = check_content.count(chen_new_avatar)
print(f"✅ 陈沐谦新头像在mockData.js中出现 {chen_count}")