fix: make full_margin env save/restart reliable (no empty numeric wipe).

EOF

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-17 19:07:38 +08:00
parent 3b8c2d4799
commit fda5d121ea
4 changed files with 99 additions and 6 deletions
+10 -2
View File
@@ -23,8 +23,15 @@ _POST_LICENSE_TARGET = "/login"
def _license_public_path(path: str) -> bool:
"""未授权时仍可访问的路径(授权页 / 接口 / 静态资源)。"""
if path in ("/license", "/api/license/status", "/api/license/redeem", "/api/license/validate", "/health"):
"""未授权时仍可访问的路径(授权页 / 接口 / 静态资源 / 重启探活)。"""
if path in (
"/license",
"/api/license/status",
"/api/license/redeem",
"/api/license/validate",
"/health",
"/api/admin/health",
):
return True
if path.startswith("/static/"):
return True
@@ -33,6 +40,7 @@ def _license_public_path(path: str) -> bool:
return False
def _license_manage_requested() -> bool:
"""已授权时默认禁止进入 /license;续费/换机用 ?renew=1。"""
return (request.args.get("renew") or request.args.get("manage") or "").strip().lower() in (