From 2a020e17e910c4920c23cb4e7adb09c32f57093e Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 21 Aug 2026 17:09:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(rbac):=20find=5Funauth=5Ffiles=20=E7=94=A8?= =?UTF-8?q?=20ref=5Freal=5Fpath=20=E6=9B=BF=E4=BB=A3=20=5F=5Ffile=5F=5F=20?= =?UTF-8?q?+=20seed=20user=5Fstatus=20=E5=AD=97=E5=85=B8(init/data.json)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init/data.json | 23 +++++++++++++++++++++++ wwwroot/find_unauth_files.dspy | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 init/data.json diff --git a/init/data.json b/init/data.json new file mode 100644 index 0000000..37ea364 --- /dev/null +++ b/init/data.json @@ -0,0 +1,23 @@ +{ + "appcodes": [ + { + "id": "user_status", + "name": "用户状态", + "hierarchy_flg": "0" + } + ], + "appcodes_kv": [ + { + "id": "user_status_0", + "parentid": "user_status", + "k": "0", + "v": "可用" + }, + { + "id": "user_status_1", + "parentid": "user_status", + "k": "1", + "v": "禁用" + } + ] +} diff --git a/wwwroot/find_unauth_files.dspy b/wwwroot/find_unauth_files.dspy index 4069989..0c20e01 100644 --- a/wwwroot/find_unauth_files.dspy +++ b/wwwroot/find_unauth_files.dspy @@ -1,7 +1,8 @@ wwwroot = params_kw.get('wwwroot', '').strip() async with get_sor_context(request._run_ns, 'rbac') as sor: - title, message, is_error = await request._run_ns.scan_unauth_files(sor, wwwroot, __file__) + # dspy 运行时无 __file__,用 ahserver 注入的 ref_real_path(本 dspy 文件真实绝对路径) + title, message, is_error = await request._run_ns.scan_unauth_files(sor, wwwroot, request._run_ns.ref_real_path) if is_error: return UiError(title=title, message=message)