From c4e8406c6fbb394dd26127ccaf40ecf85178301c Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 27 Aug 2026 00:14:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(load=5Fpath):=20set=5Frole=5Fperm.py=20?= =?UTF-8?q?=E7=94=A8=E5=AE=BF=E4=B8=BB=E6=A0=B9=E7=BB=9D=E5=AF=B9=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=EF=BC=88=E5=90=A6=E5=88=99=E5=9C=A8=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=89=A7=E8=A1=8C=E6=97=B6=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E6=96=87=E4=BB=B6=EF=BC=8C0/68=20=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/load_path.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/load_path.py b/scripts/load_path.py index 40b4dc9..9ba68fe 100644 --- a/scripts/load_path.py +++ b/scripts/load_path.py @@ -2,12 +2,16 @@ """RBAC path registration for pipeline-bidding module. 与平台惯例一致:静态资源 → any(免登录),页面/CRUD/API → logined。 -由宿主应用根目录执行:py3/bin/python pkgs/pipeline-bidding/scripts/load_path.py +在宿主应用根目录执行(set_role_perm.py 位于宿主根): + cd && py3/bin/python pkgs/pipeline-bidding/scripts/load_path.py """ +import os import subprocess import sys MOD = "pipeline-bidding" +# set_role_perm.py 在宿主应用根目录(本脚本位于 /pkgs/pipeline-bidding/scripts/) +APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")) TABLES = [ "bid_mail_accounts", "bid_tenders", "bid_members", "bid_tender_files", @@ -42,8 +46,8 @@ PATHS_LOGINED += [ def _run(role, path): - r = subprocess.run([sys.executable, "set_role_perm.py", role, path], - capture_output=True, text=True) + r = subprocess.run([sys.executable, os.path.join(APP_ROOT, "set_role_perm.py"), role, path], + capture_output=True, text=True, cwd=APP_ROOT) if r.returncode != 0: print(" FAIL [%s] %s: %s" % (role, path, (r.stderr or "").strip()[:120])) return r.returncode == 0