diff --git a/admin/dashboard/blueprints/contacts.py b/admin/dashboard/blueprints/contacts.py index 27dec1b..4b93c15 100644 --- a/admin/dashboard/blueprints/contacts.py +++ b/admin/dashboard/blueprints/contacts.py @@ -266,9 +266,9 @@ def api_send_message(): if 'file' not in request.files: return jsonify({'success': False, 'message': '未上传文件'}) file = request.files['file'] - if file.name.endswith('.mp3'): + if file.filename.endswith('.mp3'): format_str = "mp3" - elif file.name.endswith('.wav'): + elif file.filename.endswith('.wav'): format_str = "wav" else: return jsonify({