@ -198,16 +198,18 @@ def checkCookie(request):
@app.before_request
def before_request():
g.db = connect_db()
g.isconnect_db = False
if request.path != "/sso" and (not checkCookie(request)):
return redirect_sso()
g.isconnect_db = True
@app.after_request
def after_request(response):
if g.db != None:
if g.isconnect_db:
g.db.close()
g.db = None
return response