mirror of
https://github.com/MeowLynxSea/CatismImage.git
synced 2025-07-09 10:54:35 +00:00
修复上传图片校验失败的问题
This commit is contained in:
parent
7d79e4a3c9
commit
7c6eed2022
Binary file not shown.
@ -60,6 +60,8 @@ def upload_image():
|
||||
file.seek(0)
|
||||
except Exception:
|
||||
return jsonify({'error': '无效的图片文件'}), 400
|
||||
except Exception:
|
||||
return jsonify({'error': '无效的图片文件'}), 400
|
||||
|
||||
# 如果启用了NSFW检查
|
||||
if AppConfig.ENABLE_NSFW_FILTER:
|
||||
@ -81,8 +83,6 @@ def upload_image():
|
||||
file.seek(0)
|
||||
except Exception as e:
|
||||
return jsonify({'error': f'NSFW检查失败: {str(e)}'}), 500
|
||||
except Exception:
|
||||
return jsonify({'error': '无效的图片文件'}), 400
|
||||
|
||||
# 获取文件大小并检查存储空间
|
||||
file.seek(0, 2) # 移动到文件末尾
|
||||
|
Loading…
Reference in New Issue
Block a user