refactor: ♻️ 优化CURD组件权限处理

将权限属性名从 auth 统一修改为 perm,保持命名一致性
更新 permPrefix 替代 pageName 作为权限前缀标识
优化权限检查逻辑,未设置权限标识的按钮默认显示
This commit is contained in:
Ray.Hao
2025-04-18 23:58:38 +08:00
parent 80ea3a0262
commit 7c8a149bcf
8 changed files with 129 additions and 54 deletions

View File

@@ -1,7 +1,7 @@
import type { IContentConfig } from "@/components/CURD/types";
const contentConfig: IContentConfig = {
// pageName: "sys:demo", // 不写不进行按钮权限校验
// permPrefix: "sys:demo", // 不写不进行按钮权限校验
table: {
showOverflowTooltip: true,
},
@@ -118,7 +118,7 @@ const contentConfig: IContentConfig = {
{
name: "reset_pwd",
text: "重置密码",
auth: "password:reset",
perm: "password:reset",
attrs: { icon: "refresh-left", type: "primary" },
render(row) {
// 根据条件,显示或隐藏