调整目录结构

This commit is contained in:
zhengxinonly
2021-06-12 21:20:13 +08:00
parent 48633729fb
commit d9a5bcb0de
590 changed files with 1072 additions and 1160 deletions
+20
View File
@@ -0,0 +1,20 @@
# xss过滤
from flask import abort, make_response, jsonify
def xss_escape(s: str):
if s is None:
return None
else:
return s.replace("&", "&amp;").replace(">", "&gt;").replace("<", "&lt;").replace("'", "&#39;").replace('"',
"&#34;")
def check_data(schema, data):
errors = schema.validate(data)
for k, v in errors.items():
for i in v:
# print("{}{}".format(k, i))
msg = "{}{}".format(k, i)
if errors:
abort(make_response(jsonify(result=False, msg=msg), 200))