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:
wangfq
2026-06-10 14:29:14 +08:00
parent 4b91455485
commit 4c337b60ae
3 changed files with 7 additions and 5 deletions

View File

@@ -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"])