python学习
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user