From 7121c3acccc113dd1bfadd89211f4aa2f6478142 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 25 Jun 2026 16:32:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DCRUD=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E9=97=AE=E9=A2=98=20=E2=80=94=20=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E8=B7=AF=E5=BE=84=E4=BB=8Eany=E7=A7=BB=E5=88=B0logine?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CRUD列表目录(suppliers_list等)注册在any角色导致服务器直接返回原始JSON (Content-Type: application/json)而非通过bricks模板引擎渲染为HTML。 修复:将所有CRUD目录路径从PATHS_ANY移到PATHS_LOGINED, 确保服务器走bricks模板引擎处理。 --- scripts/load_path.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/scripts/load_path.py b/scripts/load_path.py index 8b2f1f2..096e73f 100755 --- a/scripts/load_path.py +++ b/scripts/load_path.py @@ -48,20 +48,9 @@ if not os.path.exists(SET_PERM_SCRIPT): # 权限路径定义 # ============================================================ -# any — 无需登录,静态资源/CRUD 别名目录 +# any — 无需登录,静态资源/菜单 PATHS_ANY = [ "/supplychain/menu.ui", - "/supplychain/suppliers_list", - "/supplychain/supply_contracts_list", - "/supplychain/supply_contract_items_list", - "/supplychain/sub_distributors_list", - "/supplychain/distribution_agreements_list", - "/supplychain/distribution_agreement_items_list", - "/supplychain/supplychain_accounting_list", - "/supplychain/platform_supply_relations_list", - "/supplychain/platform_supply_products_list", - "/supplychain/product_supplier_mapping_list", - "/supplychain/supplier_resource_price_list", ] # logined — 需要认证的页面和 API @@ -75,6 +64,18 @@ PATHS_LOGINED = [ "/supplychain/sub_distributors.ui", "/supplychain/distribution_agreements.ui", "/supplychain/accounting.ui", + # CRUD 列表目录(需要 bricks 模板渲染) + "/supplychain/suppliers_list", + "/supplychain/supply_contracts_list", + "/supplychain/supply_contract_items_list", + "/supplychain/sub_distributors_list", + "/supplychain/distribution_agreements_list", + "/supplychain/distribution_agreement_items_list", + "/supplychain/supplychain_accounting_list", + "/supplychain/platform_supply_relations_list", + "/supplychain/platform_supply_products_list", + "/supplychain/product_supplier_mapping_list", + "/supplychain/supplier_resource_price_list", # CRUD 列表页 "/supplychain/suppliers_list/index.ui", "/supplychain/supply_contracts_list/index.ui",