新增 消息定时推送功能

This commit is contained in:
liuwei
2025-06-10 11:52:02 +08:00
parent 0e0189a50f
commit 3a1e0f1d20

View File

@@ -54,9 +54,14 @@ def api_create_task():
if not data:
return jsonify({"success": False, "error": "无效的请求数据"}), 400
# 获取用户名
username = session.get('username')
if not username:
return jsonify({"success": False, "error": "未登录或会话已过期"}), 401
# 生成任务ID
data['task_id'] = str(uuid.uuid4())
data['creator_id'] = session.get('user_id') # 从session中获取用户ID
data['creator_id'] = username
# 创建任务
db = current_app.dashboard_server.task_db