diff options
| author | handingkang <[email protected]> | 2024-05-23 22:50:43 +0800 |
|---|---|---|
| committer | handingkang <[email protected]> | 2024-05-23 22:50:43 +0800 |
| commit | 790e0618e68883d341d6206f486a28165ede4fdf (patch) | |
| tree | 42a5d3475b9c8804e7c8a2350113133f5547f350 | |
| parent | 37e920d5edc7e782a10d397b9e5dd15429278317 (diff) | |
/task/del接口新增对非法任务id的处理
| -rw-r--r-- | server/apps/task.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/server/apps/task.py b/server/apps/task.py index 74be644..972c6d7 100644 --- a/server/apps/task.py +++ b/server/apps/task.py @@ -399,6 +399,8 @@ def del_task(json_data): try: da.cursor.execute(sql) da.conn.commit() + if da.cursor.rowcount == 0: + return {"code": "404", "msg": "该任务id未找到!"} except Exception as e: error(str(e)) return {"code": 500, "msg": str(e)} |
