安全加固:CORS白名单、JWT密钥自动生成、SSRF防护、路径遍历与错误信息泄露修复

This commit is contained in:
2026-08-25 18:05:28 +08:00
parent 9df0747ca2
commit a0d83d9e8f
12 changed files with 168 additions and 31 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ def admin_required(f):
return redirect(url_for('auth.login'))
except Exception as exc:
if _is_ajax_request():
return jsonify({'success': False, 'error': str(exc)}), 500
return jsonify({'success': False, 'error': '服务器内部错误,请稍后重试'}), 500
return redirect(url_for('auth.login'))
return f(*args, **kwargs)
return decorated