python学习

This commit is contained in:
2019-08-07 10:51:39 +08:00
parent 630e16a759
commit 7b8acc0a89
4 changed files with 93 additions and 78 deletions

View File

@@ -14,11 +14,15 @@ def before_request():
ignore_check_login_urls = app.config['IGNORE_CHECK_LOGIN_URLS']
path = request.path
# 如果是静态文件就不要查询用户信息了
pattern = re.compile('%s' % "|".join(ignore_check_login_urls))
if pattern.match(path):
return
if '/api' in path:
return
user_info = check_login()
g.current_user=None
if user_info: