fix: refresh 参数支持 URL query string(原来只读JSON body, ?refresh=1 无效)

This commit is contained in:
2026-09-14 13:16:51 +08:00
parent 7c00ed2e47
commit efdfaecccd
+3 -1
View File
@@ -1649,7 +1649,9 @@ def capture():
settings = load_capture_settings() settings = load_capture_settings()
cache_cfg = settings.get("cache", DEFAULT_CACHE_CONFIG) cache_cfg = settings.get("cache", DEFAULT_CACHE_CONFIG)
retry_cfg = settings.get("retry", DEFAULT_RETRY_CONFIG) retry_cfg = settings.get("retry", DEFAULT_RETRY_CONFIG)
force_refresh = bool(data.get("refresh") or data.get("force")) force_refresh = bool(data.get("refresh") or data.get("force")) or \
str(request.args.get("refresh") or "").lower() in ("1", "true", "yes") or \
str(request.args.get("force") or "").lower() in ("1", "true", "yes")
# per-request 缓存参数:cache_ttl_seconds=本次缓存时效(秒, -1=永久, 覆盖全局)cache=false / no_cache=true=本次禁用缓存 # per-request 缓存参数:cache_ttl_seconds=本次缓存时效(秒, -1=永久, 覆盖全局)cache=false / no_cache=true=本次禁用缓存
no_cache = data.get("cache") is False or str(data.get("no_cache")).lower() in ("true", "1", "yes") no_cache = data.get("cache") is False or str(data.get("no_cache")).lower() in ("true", "1", "yes")
try: try: