mirror of
https://github.com/MeowLynxSea/CatismImage.git
synced 2025-07-09 19:04:34 +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)
|
file.seek(0)
|
||||||
except Exception:
|
except Exception:
|
||||||
return jsonify({'error': '无效的图片文件'}), 400
|
return jsonify({'error': '无效的图片文件'}), 400
|
||||||
|
except Exception:
|
||||||
|
return jsonify({'error': '无效的图片文件'}), 400
|
||||||
|
|
||||||
# 如果启用了NSFW检查
|
# 如果启用了NSFW检查
|
||||||
if AppConfig.ENABLE_NSFW_FILTER:
|
if AppConfig.ENABLE_NSFW_FILTER:
|
||||||
@ -81,8 +83,6 @@ def upload_image():
|
|||||||
file.seek(0)
|
file.seek(0)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return jsonify({'error': f'NSFW检查失败: {str(e)}'}), 500
|
return jsonify({'error': f'NSFW检查失败: {str(e)}'}), 500
|
||||||
except Exception:
|
|
||||||
return jsonify({'error': '无效的图片文件'}), 400
|
|
||||||
|
|
||||||
# 获取文件大小并检查存储空间
|
# 获取文件大小并检查存储空间
|
||||||
file.seek(0, 2) # 移动到文件末尾
|
file.seek(0, 2) # 移动到文件末尾
|
||||||
|
Loading…
Reference in New Issue
Block a user