Commit Graph

254 Commits

Author SHA1 Message Date
Trae AI 9ea0ef4536 fix: 编辑版本时基础版本选择器排除当前版本 2026-06-18 17:05:30 +08:00
Trae AI 472d65eeb2 fix: 版本编辑时UpdateType变化自动更新全量包,禁止选择自身作为基础版本 2026-06-18 17:03:41 +08:00
Trae AI 23fdcb4a7e fix: check-update无版本号时download_url优先指向全量包 2026-06-18 16:15:29 +08:00
Trae AI 69cac1237c fix: 修复应用设置保存时字段覆盖问题; check-update无版本号时返回full_package_url 2026-06-18 13:06:33 +08:00
Trae AI 4a6fc087c6 fix: 修复应用设置保存时未传字段被覆盖为空值/默认值的问题 2026-06-18 12:38:19 +08:00
Trae AI 6ca561404d fix: AppCryptoMiddleware添加请求体解密逻辑,修复AES加密通信登录失败 2026-06-17 23:40:31 +08:00
admin 59f7b00b9d chore: 默认品牌名从'微授权'改为'网络验证'
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-16 03:25:30 +08:00
admin cb688be222 fix: 心跳接口根据运营模式返回不同信息
- 订阅模式返回到期时间 expiry_at
- 余额模式返回余额 balance
- 永久会员返回 is_permanent 标识
- 免费模式只返回成功消息

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-16 03:00:07 +08:00
admin 113c01e89f feat: 心跳接口改用JWT token获取用户设备信息
- JWT Claims 增加 device_id 和 instance_id 字段
- 登录时将设备信息编码到 token
- 心跳接口从 token 自动获取用户和设备信息
- 心跳路由移到需要 JWT 认证的路由组
- 更新 API 文档

优点:
- 更安全:无法伪造设备信息
- 请求更简洁:心跳无需传递参数
- 符合业界标准做法

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-16 02:25:53 +08:00
admin 5bbae23bca feat: 用户管理页面添加充值功能
- 后端新增 POST /app-users/:id/recharge API
- 前端新增独立的用户充值页面 (/admin/users/:id/recharge)
- 充值页面风格与添加用户/编辑用户页面一致
- 支持选择卡密类型和数量进行充值
- 永久会员显示提示不允许充值

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-14 11:49:34 +08:00
admin d1228954ea perf: 静态文件完全绕过所有中间件
- 使用 gin.New() 替代 gin.Default(),避免默认中间件
- 添加 skipUploads 包装器,所有中间件跳过 /uploads/ 路径
- 静态文件路由注册在最前面,零中间件开销
- 移除 gzipMiddleware 中重复的跳过逻辑

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-13 00:22:21 +08:00
admin 0d08bcc0f8 perf: 大幅优化静态文件下载性能
- 使用 http.ServeFile 替代手动实现,利用 sendfile 零拷贝
- gzip 中间件跳过 /uploads/ 路径,避免额外开销
- 支持 Range 请求和断点续传(由标准库自动处理)
- 移除不必要的手动 MIME 类型映射

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-12 23:46:26 +08:00
admin 6c191d1b0d perf: 优化静态文件下载性能,支持断点续传
- 替换 Gin 默认 Static 为自定义处理器
- 支持 Range 请求头,实现断点续传
- 使用 1MB 大缓冲区,减少系统调用次数
- 添加 Accept-Ranges 和精确 Content-Length 响应头
- 设置正确的 MIME 类型映射

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-12 23:08:53 +08:00
admin 21b337f7c3 fix: 修复 Megaphone 图标导入拼写错误 2026-06-06 12:29:11 +08:00
admin 1cb8f11acd fix: 修复系统设置动态注入到静态文件
- 简化前端 useSiteSettings,直接使用后端注入的 window.__SITE_CONFIG__
- 修复后端 serveIndexHTML 中的设置 key 名,与前端的 key 名一致
- site_name 替换为正确的数据库字段名
- logo 和 favicon 使用 site_logo 和 site_favicon
- 添加 getLogo 函数根据主题自动选择 logo

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 13:59:03 +08:00
admin 53ab7fd778 fix: 修复系统设置的动态注入问题
- 创建 useSiteSettings composable 在应用启动时加载系统设置
- 从 window.__SITE_CONFIG__(后端注入)和 localStorage 初始化设置
- 修复 favicon 更新逻辑,正确移除旧 favicon 并添加新的
- 在路由守卫中设置页面标题,格式为 '页面名 - 网站名'
- 简化 admin.vue 和 admin-sidebar 组件,使用统一的设置管理

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 13:15:31 +08:00
admin 7eb232fd8e fix: 恢复 SidebarRail 拖拽鼠标样式,移除右上角主题设置弹窗
- 恢复 SidebarRail 的 cursor-w-resize/cursor-e-resize 样式
- 移除右上角的 ThemePopover 组件

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 12:53:10 +08:00
admin e89b212dbb fix: 修复侧边栏拖拽区域的国际化文案和鼠标样式
- 添加 toggleSidebar 的中英文翻译
- 移除无效的拖拽鼠标样式,改为 pointer
- 使用 i18n 替换硬编码的英文文本

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 05:15:24 +08:00
admin 3716a2a80f fix: 修复 DataTable 组件未传递 onDownloadFullPackage prop
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 05:06:27 +08:00
admin bba8f5bdb8 fix: 补丁版本总是显示下载完整包按钮
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 04:53:37 +08:00
admin fd6384191c feat: 版本管理页面添加下载补丁包和完整包的操作按钮
- 补丁类型版本显示两个下载按钮:下载补丁包、下载完整包
- 全量版本显示一个下载按钮
- 添加相应的中英文翻译

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 04:12:21 +08:00
admin 62ea1da578 fix: 修复补丁包返回逻辑,download_url 应返回补丁包地址
- 当最新版本是补丁类型时,download_url 返回补丁包地址(FilePath)
- full_package_url 返回完整包地址作为备选
- 简化判断逻辑,不再根据客户端版本判断

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 03:50:41 +08:00
admin 8b887f432b fix: 简化检测更新 API 返回数据,移除 files 字段
- 移除 ZIP 包内文件列表的返回,客户端只需要补丁包/完整包信息
- 返回数据更简洁:download_url, file_size, file_hash, patch_url 等

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 03:47:21 +08:00
admin 0d60037e4e fix: 修复检测更新 API 正确处理补丁包
- 当最新版本是补丁类型且客户端版本是基础版本时,返回补丁包地址
- 当最新版本是补丁类型但客户端不是基础版本时,返回完整包地址
- 添加 full_package_url/full_package_size/full_package_hash 字段作为备选
- 移除冗余的补丁查询逻辑

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 03:21:16 +08:00
admin beae161078 feat: 创建和编辑版本时保存文件列表到数据库
- 在 CreateVersionRequest 和 UpdateVersionRequest 中添加 Files 字段
- 创建版本时保存文件列表到 VersionFile 表
- 更新版本时删除旧文件记录并创建新的
- 前端创建和编辑版本时传递文件列表
- 修复检测更新 API 使用正确的字段名 (publish_status=published)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 03:07:42 +08:00
admin 97dbd76414 fix: 修复检测更新 API 使用正确的字段名
- 将 status 字段改为 publish_status
- 将 active 值改为 published
- 确保能正确查询已发布的版本

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 02:54:02 +08:00
admin 1575d32133 feat: 添加编辑页面基础版本选择功能
- 在编辑页面添加基础版本选择器
- 加载已有版本时自动填充 base_version_id
- 更新版本时传递 base_version_id 参数
- 移除创建页面的调试代码

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 00:30:16 +08:00
admin bcde5abfa3 debug: 添加 update_type 调试显示
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 23:15:17 +08:00
admin ad58d2220e feat: 添加补丁版本基础版本选择功能
- 添加基础版本下拉选择器,仅在补丁更新类型时显示
- 添加应用和更新类型的 watch 监听,自动获取全量版本列表
- 提交时传递 base_version_id 参数
- 添加调试日志便于排查问题

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 22:48:22 +08:00
admin 026581ea60 fix: 编辑补丁版本时重新合并生成全量包
当编辑版本并更新文件时,如果是补丁包类型,需要重新与基础全量包合并生成新的全量包

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-02 00:02:28 +08:00
admin b86fc60741 feat: 添加文件上传进度和速度显示
- 新增 api.postFormDataWithProgress 方法支持上传进度回调
- 版本创建和编辑页面显示上传进度条和实时速度
- 按钮显示上传百分比
- 添加国际化翻译

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 22:01:16 +08:00
admin c755587a4d feat: 完善版本管理功能
后端改进:
- 新增版本发布状态管理 (draft/published/deprecated/superseded)
- 新增发布/废弃/回滚 API 接口
- 新增增量包生成功能 (仅包含差异文件)
- 新增删除版本时的依赖检查
- 数据库字段: publish_status, superseded_by, delta_package_*

前端改进:
- 版本列表新增发布状态列和增量包大小列
- 新增发布/废弃/回滚操作按钮
- 新增增量包下载功能
- 更新国际化翻译

修复:
- 修复 announcements 页面 typeOptions 未定义问题
- 修复 echarts 模块导入类型问题

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 20:31:52 +08:00
admin c3e44c74da fix: fallback to FilePath when FullPackagePath is empty
When old versions don't have full_package_path set, use file_path instead

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 18:32:03 +08:00
admin 93f1e899fc refactor: simplify to maintain only one latest full package per app
- Remove per-version full package storage
- Remove RegenerateDependentVersions logic
- Only generate full package for the latest version
- Simplify package_util.go

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 12:58:43 +08:00
admin a17938c000 feat: regenerate dependent versions after deletion
- Add RegenerateFullPackage function to rebuild single version's full package
- Add RegenerateDependentVersions function to handle cascade regeneration
- Call regeneration after deleting versions
- Each version maintains its own full package independently

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 12:10:30 +08:00
admin 551f4f1576 feat: auto-generate full package when uploading patch
- Add FullPackagePath, FullPackageSize, FullPackageHash to Version model
- When uploading patch, merge with base full package to create new full package
- Check update API returns full package info for download
- Add package_util.go with merge functions

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 11:43:58 +08:00
admin fd98c0dcc4 feat: delete old file when updating version with new file
If file_path is different from existing file, remove the old file

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 10:09:23 +08:00
admin 8cb867e65b fix: save file info when updating version
- Add file_path, file_size, file_hash, entry_file to UpdateVersionRequest
- Update these fields when saving version changes
- Update originalUploadedData after successful save

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 09:25:39 +08:00
admin 47f1e9fe43 fix: show existing files when editing version
- Load files data when fetching version info
- Display uploaded file info with re-upload option
- Preserve original file data when canceling re-upload
- Add i18n for reupload button

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 00:58:36 +08:00
admin 0a20892f94 fix: calculate total file size on backend instead of frontend
- Backend returns total_size for all matching versions
- Frontend uses backend's total_size instead of computing from current page

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 00:11:33 +08:00
admin 275698a32b fix: return param error when version not found in database
Change 404 to 400 with "版本号参数错误" message

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 13:21:54 +08:00
admin 7af4da30d3 feat: return latest version when no version param provided
If client doesn't provide version parameter, return latest version info
instead of returning error

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 13:11:13 +08:00
admin 65a9465af4 fix: logout requires both device_id and instance_id
Only clear specific instance on specific device
Remove cross-device and all-instances clearing

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 18:24:23 +08:00
admin 008e66f84e fix: require instance_id when device_id is provided on logout
- Only device_id without instance_id returns error
- Three valid combinations:
  - device_id + instance_id: clear specific instance
  - only instance_id: clear instance across devices
  - no params: clear all instances

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 18:20:33 +08:00
admin ab3f188c04 fix: logout only clears instances, not devices
- Remove device deletion on logout
- Only delete DeviceSession records
- Support clearing specific instance or all instances

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 18:18:31 +08:00
admin f5343281a3 feat: add app user routes (logout, user-info, avatar, tickets)
- Logout: clear device sessions on logout
- User info: return expiry/balance based on billing type
- Avatar upload: support jpg/png/gif/webp, max 2MB
- App tickets: create, reply, close tickets for app users
- Add ClosedAt field to Ticket model

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 18:09:05 +08:00
admin 5298f8f58e feat: return expiry/balance based on billing type on login
- Return expiry_at for subscription mode
- Return balance for usage-based mode
- Return is_permanent for permanent members

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 17:58:33 +08:00
admin 87fba96264 fix: remove auto v prefix from version display
Display raw version number from database without adding v prefix

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 16:55:28 +08:00
admin 16c68a855b fix: version display and comparison issues
- Remove duplicate 'v' prefix in version display
- Add version string cleanup (trim spaces, remove v/V prefix)
- Use custom download URL when set
- Fix has_update logic for same version comparison

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 16:53:46 +08:00
admin 53fd9ff7dc feat: add custom download URL for manual update method
- Add custom_download_url field to Version model
- Show custom download URL input when update method is 'manual'
- Use platform default URL if custom URL is not set
- Add i18n translations for new field

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 16:06:48 +08:00