mirror of
https://gitcode.com/JianFeeeee/TrulyMEM-TrueHumanMEM.git
synced 2026-10-15 12:15:32 +00:00
fix: 静态页面添加 Cache-Control 禁用缓存,重启后无需重新登录
This commit is contained in:
@ -150,14 +150,22 @@ def admin_required(f):
|
|||||||
@login_required
|
@login_required
|
||||||
def index():
|
def index():
|
||||||
"""默认首页 - 星图页面"""
|
"""默认首页 - 星图页面"""
|
||||||
return app.send_static_file('graph.html')
|
resp = app.send_static_file('graph.html')
|
||||||
|
resp.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
|
||||||
|
resp.headers['Pragma'] = 'no-cache'
|
||||||
|
resp.headers['Expires'] = '0'
|
||||||
|
return resp
|
||||||
|
|
||||||
|
|
||||||
@app.route('/graph.html')
|
@app.route('/graph.html')
|
||||||
@login_required
|
@login_required
|
||||||
def graph_html():
|
def graph_html():
|
||||||
"""返回星图页面"""
|
"""返回星图页面"""
|
||||||
return app.send_static_file('graph.html')
|
resp = app.send_static_file('graph.html')
|
||||||
|
resp.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
|
||||||
|
resp.headers['Pragma'] = 'no-cache'
|
||||||
|
resp.headers['Expires'] = '0'
|
||||||
|
return resp
|
||||||
|
|
||||||
# 全局服务器和客户端实例
|
# 全局服务器和客户端实例
|
||||||
backend_server: BackendServer = None
|
backend_server: BackendServer = None
|
||||||
|
|||||||
Reference in New Issue
Block a user