fix: 认证系统、登录兼容性、运行时配置、钉钉通知及代码清理
- 实现 JWT 认证中间件,保护配置管理和任务删除接口 - 修复 ConfigView 登录按钮(Vue 3 inject 替代 $root) - 页面刷新时通过 /api/auth/me 校验 token 有效性 - max_concurrent_builds 修改后运行时即时生效 - 实现钉钉 webhook 通知(构建成功/失败自动推送) - 删除未使用的 useWebSocket composable - log_streamer 使用 LOG_QUEUE_MAX_SIZE 配置常量
This commit is contained in:
@@ -309,6 +309,11 @@ async def run_build_task(task_id: str):
|
||||
if task.oss_url:
|
||||
await log_streamer.emit(task_id, f"下载链接: {task.oss_url}")
|
||||
|
||||
# 钉钉通知
|
||||
from .notification import notify_build_result
|
||||
dingtalk = full_config.get("upload", {}).get("dingtalk", {})
|
||||
await notify_build_result(task, dingtalk)
|
||||
|
||||
# 带超时执行打包
|
||||
await asyncio.wait_for(_do_build(), timeout=timeout_seconds)
|
||||
|
||||
@@ -330,6 +335,11 @@ async def run_build_task(task_id: str):
|
||||
await log_streamer.emit(task_id, f"临时文件保留在: {build_dir}")
|
||||
await asyncio.to_thread(log_streamer.save_log, task_id, build_dir)
|
||||
|
||||
# 钉钉通知
|
||||
from .notification import notify_build_result
|
||||
dingtalk = full_config.get("upload", {}).get("dingtalk", {})
|
||||
await notify_build_result(task, dingtalk)
|
||||
|
||||
except asyncio.CancelledError:
|
||||
await asyncio.to_thread(_db_update, db, task,
|
||||
status="cancelled", completed_at=datetime.utcnow())
|
||||
@@ -362,6 +372,11 @@ async def run_build_task(task_id: str):
|
||||
await log_streamer.emit(task_id, f"临时文件保留在: {build_dir}")
|
||||
await asyncio.to_thread(log_streamer.save_log, task_id, build_dir)
|
||||
|
||||
# 钉钉通知
|
||||
from .notification import notify_build_result
|
||||
dingtalk = full_config.get("upload", {}).get("dingtalk", {})
|
||||
await notify_build_result(task, dingtalk)
|
||||
|
||||
finally:
|
||||
log_streamer.complete(task_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user