diff --git a/backend/app/__pycache__/config.cpython-312.pyc b/backend/app/__pycache__/config.cpython-312.pyc deleted file mode 100644 index 6391ad2..0000000 Binary files a/backend/app/__pycache__/config.cpython-312.pyc and /dev/null differ diff --git a/backend/app/__pycache__/main.cpython-312.pyc b/backend/app/__pycache__/main.cpython-312.pyc deleted file mode 100644 index dda4801..0000000 Binary files a/backend/app/__pycache__/main.cpython-312.pyc and /dev/null differ diff --git a/backend/app/service/__init__.py b/backend/app/service/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/backend/app/services/text_analysis_service_fixed.py b/backend/app/services/text_analysis_service_fixed.py deleted file mode 100644 index e69de29..0000000 diff --git a/backend/test_font_config.py b/backend/test_font_config.py deleted file mode 100644 index f317552..0000000 --- a/backend/test_font_config.py +++ /dev/null @@ -1,71 +0,0 @@ -""" -测试字体配置是否正常工作 -""" -import matplotlib.pyplot as plt -import matplotlib -import numpy as np -from app.services.font_helper import configure_matplotlib_fonts -import io -import base64 - -# 配置字体 -font_name = configure_matplotlib_fonts() - -print(f"当前使用字体: {font_name}") -print(f"matplotlib 中文字体设置: {matplotlib.rcParams['font.sans-serif']}") - -# 创建测试图表 -fig, ax = plt.subplots(figsize=(10, 6)) - -# 测试数据 -x = ['销售', '库存', '采购', '退货', '其他'] -y = [150, 200, 180, 50, 30] - -bars = ax.bar(x, y, color='#3b82f6', alpha=0.8) -ax.set_xlabel('类别', fontsize=12, labelpad=10) -ax.set_ylabel('数值', fontsize=12, labelpad=10) -ax.set_title('测试图表 - 中文显示', fontsize=14, fontweight='bold', pad=15) -ax.tick_params(axis='both', which='major', labelsize=10) - -# 添加数值标签 -for bar, value in zip(bars, y): - height = bar.get_height() - ax.text(bar.get_x() + bar.get_width() / 2., height, - f'{value}', - ha='center', va='bottom', fontsize=10, fontweight='bold') - -plt.grid(axis='y', alpha=0.3) -plt.tight_layout(pad=1.5) - -# 转换为 base64 -buf = io.BytesIO() -fig.savefig(buf, format='png', dpi=120, bbox_inches='tight', pad_inches=0.3, facecolor='white') -plt.close(fig) - -buf.seek(0) -img_base64 = base64.b64encode(buf.read()).decode('utf-8') -data_url = f"data:image/png;base64,{img_base64}" - -print("\n=== 测试完成 ===") -print(f"图表大小: {len(img_base64)} 字符") -print("如果看到字体警告,请检查系统是否有安装中文字体") - -# 尝试获取所有可用字体 -import matplotlib.font_manager as fm -available_fonts = set([f.name for f in fm.fontManager.ttflist]) - -print(f"\n=== 可用字体列表(部分)===") -chinese_fonts = [f for f in available_fonts if 'CJK' in f or 'Chinese' in f or 'YaHei' in f or 'SimHei' in f or 'PingFang' in f] -for font in sorted(chinese_fonts)[:10]: - print(f" - {font}") - -if not chinese_fonts: - print(" 未找到中文字体!") - -print("\n=== 推荐安装的中文字体 ===") -print("Windows: Microsoft YaHei (系统自带)") -print("macOS: PingFang SC (系统自带)") -print("Linux: fonts-noto-cjk 或 fonts-wqy-zenhei") - -print("\n=== 生成的 base64 数据(前100字符)===") -print(data_url[:100] + "...") diff --git a/frontend/.env.example b/frontend/.env.example new file mode 100644 index 0000000..07ac86d --- /dev/null +++ b/frontend/.env.example @@ -0,0 +1,7 @@ +VITE_APP_ID= + +VITE_SUPABASE_URL= + +VITE_SUPABASE_ANON_KEY= + +VITE_BACKEND_API_URL=http://localhost:8000/api/v1