fix: 修复浏览器缓存导致工装参数 GET 请求返回旧数据
根因: /api/fixture/param/<id> GET 没有 Cache-Control 头,F5 刷新时 浏览器直接用磁盘缓存返回旧 TestMode,导致测试页显示旧模式。 修复: - 服务端 fixture.py: GET 响应加 Cache-Control: no-store/no-cache/must-revalidate - 客户端 test_op.js + fixture.js: 4 处 GET fetch 全部加 ?_=Date.now() 缓存破坏参数
This commit is contained in:
@@ -217,7 +217,9 @@ def api_get_serialnet(record_id):
|
||||
def api_get_fixture_param(dnt_id):
|
||||
"""获取工装测试参数"""
|
||||
param = get_fixture_param(dnt_id)
|
||||
return jsonify(param or {})
|
||||
resp = jsonify(param or {})
|
||||
resp.headers["Cache-Control"] = "no-store, no-cache, must-revalidate, max-age=0"
|
||||
return resp
|
||||
|
||||
|
||||
@bp.route("/api/fixture/param/<int:dnt_id>", methods=["POST"])
|
||||
|
||||
Reference in New Issue
Block a user