Compare commits
2 Commits
bcfb3c7a26
...
cfc06ff720
| Author | SHA1 | Date |
|---|---|---|
|
|
cfc06ff720 | |
|
|
413269304e |
17
src/app.py
17
src/app.py
|
|
@ -3945,6 +3945,23 @@ def process_tag_relation():
|
|||
"message": "缺少必要参数: tag_name"
|
||||
}), 400
|
||||
|
||||
# 处理tag_name:去除空格
|
||||
tag_name = tag_name.replace(' ', '').replace('\t', '').replace('\n', '').strip()
|
||||
|
||||
# 验证tag_name长度(不能超过10个字符)
|
||||
if len(tag_name) > 10:
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"标签名称长度不能超过10个字符,当前长度: {len(tag_name)}"
|
||||
}), 400
|
||||
|
||||
# 验证tag_name不能为空(去除空格后)
|
||||
if not tag_name:
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": "标签名称不能为空"
|
||||
}), 400
|
||||
|
||||
# 调用处理方法
|
||||
result = tag_relation_api.process_tag(
|
||||
tag_name=tag_name,
|
||||
|
|
|
|||
Loading…
Reference in New Issue