fix(load_path): set_role_perm.py 用宿主根绝对路径(否则在模块目录执行时找不到文件,0/68 注册)

This commit is contained in:
yumoqing 2026-08-27 00:14:16 +08:00
parent 300d09fe8a
commit c4e8406c6f

View File

@ -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 <APP_ROOT> && py3/bin/python pkgs/pipeline-bidding/scripts/load_path.py
"""
import os
import subprocess
import sys
MOD = "pipeline-bidding"
# set_role_perm.py 在宿主应用根目录(本脚本位于 <APP_ROOT>/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