fix: 工具广场统一18000端口 + 去除电量限制 + bot头像更新

nginx反代(tools-nginx.conf):
- 10个工具统一通过18000端口路径分发
- 解决/static/冲突(Lama精确匹配,其余给LibreTranslate)
- 解决/api/冲突(PDF用sub_filter改为/pdf-api/,/api/给imgcompress)
- Overleaf兜底处理所有未匹配的绝对路径
- 前端工具卡片统一走18000端口+路径

后端:
- 去除对话电量限制(validateUser中的num扣减逻辑)

前端:
- bot头像更新为战知logo(蓝底白字)
- LaTeX公式编辑器"复制为图片"改为"下载为图片"(解决跨域问题)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-15 19:28:23 +08:00
parent 00a50858f8
commit 570c0f3d61
5 changed files with 171 additions and 36 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -59,38 +59,45 @@ const toolCategories = reactive<Category[]>([
{
name: '📄 文档处理',
tools: [
{ id: 'stirling-pdf', name: 'Stirling PDF', icon: '', logoImg: stirlingLogo, description: 'PDF 合并、拆分、压缩、转换、加水印、OCR 识别等 30+ 功能', port: 18080, enabled: true, type: 'newtab' },
{ id: 'trwebocr', name: '图片转文字 OCR', icon: '', logoImg: trwebocrLogo, description: '中文离线 OCR识别图片中的文字和表格', port: 18083, enabled: true, type: 'newtab' },
{ id: 'libretranslate', name: '智能翻译', icon: '', logoImg: libretranslateLogo, description: '中英互译,支持文本和文件翻译,数据不出内网', port: 18084, enabled: true, type: 'newtab' },
{ id: 'stirling-pdf', name: 'Stirling PDF', icon: '', logoImg: stirlingLogo, description: 'PDF 合并、拆分、压缩、转换、加水印、OCR 识别等 30+ 功能', path: '/spdf/', enabled: true, type: 'newtab' },
{ id: 'trwebocr', name: '图片转文字 OCR', icon: '', logoImg: trwebocrLogo, description: '中文离线 OCR识别图片中的文字和表格', path: '/ocr/', enabled: true, type: 'newtab' },
{ id: 'libretranslate', name: '智能翻译', icon: '', logoImg: libretranslateLogo, description: '中英互译,支持文本和文件翻译,数据不出内网', path: '/translate/', enabled: true, type: 'newtab' },
]
},
{
name: '🖼️ 图片处理',
tools: [
{ id: 'imgcompress', name: '图片压缩转换', icon: '🗜️', description: '图片压缩、格式转换、批量处理、AI 智能抠图去背景', port: 18087, enabled: true, type: 'newtab' },
{ id: 'lama-cleaner', name: 'AI 图像擦除', icon: '🧹', description: 'AI 智能擦除图片中的水印、路人、瑕疵,自动修复画面', port: 18088, enabled: true, type: 'newtab' },
{ id: 'webp2jpg', name: '图片格式转换', icon: '🔄', description: '支持 PSD/HEIC/WebP/PNG/JPG 等格式批量互转,纯浏览器处理不上传', port: 18089, enabled: true, type: 'newtab' },
{ id: 'imgcompress', name: '图片压缩转换', icon: '🗜️', description: '图片压缩、格式转换、批量处理、AI 智能抠图去背景', path: '/imgcompress/', enabled: true, type: 'newtab' },
{ id: 'lama-cleaner', name: 'AI 图像擦除', icon: '🧹', description: 'AI 智能擦除图片中的水印、路人、瑕疵,自动修复画面', path: '/lama/', enabled: true, type: 'newtab' },
{ id: 'webp2jpg', name: '图片格式转换', icon: '🔄', description: '支持 PSD/HEIC/WebP/PNG/JPG 等格式批量互转,纯浏览器处理不上传', path: '/webp2jpg/', enabled: true, type: 'newtab' },
]
},
{
name: '🎨 创作绘图',
tools: [
{ id: 'excalidraw', name: 'Excalidraw', icon: '', logoImg: excalidrawLogo, description: '手绘风格白板,绘制流程图、架构图、示意图', port: 18081, enabled: true, type: 'newtab' },
{ id: 'pptist', name: 'AI PPT 编辑器', icon: '', logoImg: pptistLogo, description: 'AI 生成 PPT 大纲和演示文稿,在线编辑演示', port: 18085, enabled: true, type: 'newtab' },
{ id: 'excalidraw', name: 'Excalidraw', icon: '', logoImg: excalidrawLogo, description: '手绘风格白板,绘制流程图、架构图、示意图', path: '/draw/', enabled: true, type: 'newtab' },
{ id: 'pptist', name: 'AI PPT 编辑器', icon: '', logoImg: pptistLogo, description: 'AI 生成 PPT 大纲和演示文稿,在线编辑演示', path: '/ppt/', enabled: true, type: 'newtab' },
]
},
{
name: '📝 科研写作',
tools: [
{ id: 'overleaf', name: 'LaTeX 论文编辑器', icon: '📐', description: '在线 LaTeX 编辑器,支持多人协作撰写论文,实时编译预览', port: 18090, enabled: true, type: 'newtab' },
{ id: 'latex-formula', name: 'LaTeX 公式编辑器', icon: '∑', description: '在线编辑数学公式,支持希腊字母、矩阵、积分等,可复制公式或图片', port: 18091, enabled: true, type: 'newtab' },
{ id: 'overleaf', name: 'LaTeX 论文编辑器', icon: '📐', description: '在线 LaTeX 编辑器,支持多人协作撰写论文,实时编译预览', path: '/overleaf/', enabled: true, type: 'newtab' },
{ id: 'latex-formula', name: 'LaTeX 公式编辑器', icon: '∑', description: '在线编辑数学公式,支持希腊字母、矩阵、积分等,可复制公式或图片', path: '/latex/', enabled: true, type: 'newtab' },
]
},
]);
const TOOL_PORT = 18000;
const openTool = (tool: Tool) => {
if (!tool.enabled) return;
const url = tool.url || (tool.port ? `${window.location.protocol}//${window.location.hostname}:${tool.port}${tool.path || ''}` : '');
let url = '';
if (tool.path) {
url = `${window.location.protocol}//${window.location.hostname}:${TOOL_PORT}${tool.path}`;
} else if (tool.port) {
url = `${window.location.protocol}//${window.location.hostname}:${tool.port}`;
}
if (url) {
window.open(url, '_blank');
}