summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorhandingkang <[email protected]>2024-05-23 22:52:31 +0800
committerhandingkang <[email protected]>2024-05-23 22:52:31 +0800
commit70c31e54495142d5c1e859e1bc8e26cb319220f4 (patch)
treea08034b3fd82dcaae40d0033fa98790634d73e3a /server
parent790e0618e68883d341d6206f486a28165ede4fdf (diff)
/agent/del接口新增对非法代理id的处理
Diffstat (limited to 'server')
-rw-r--r--server/apps/agentcomm.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/apps/agentcomm.py b/server/apps/agentcomm.py
index e5adbca..5d2a53c 100644
--- a/server/apps/agentcomm.py
+++ b/server/apps/agentcomm.py
@@ -212,12 +212,13 @@ def agent_info(query_data):
"msg": String()
})
def del_agent(json_data):
- print(json_data)
sql = """DELETE FROM %s WHERE AGENT_ID = '%s'
""" % (MYSQL_TAB_AGENT, json_data["id"])
try:
da.cursor.execute(sql)
da.conn.commit()
+ if da.cursor.rowcount == 0:
+ return {"code": 404, "msg": "该代理id未找到!!"}
except Exception as e:
error(message=str(e))
return {"code": 500, "msg": str(e)}