用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/TencentBlueKing/bk-bcs --skill iam命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| id | eng-permission-auth |
| name | 前端权限控制方案 (IAM) |
| category | engineering |
| description | 基于蓝鲸 IAM 的前端鉴权方案,包含 v-authority 指令实现、权限组件封装及无权限交互规范。 |
| tags | ["iam","permission","authority","directive","vue3"] |
| updated_at | 2026-01-09T00:00:00.000Z |
在蓝鲸体系中,权限控制不仅仅是“显示/隐藏”,更重要的是**“发现与申请”。我们推荐使用“置灰 + 提示申请”**的交互模式。
v-authority这个指令会自动处理点击拦截、样式置灰和申请弹窗的唤起。
使用方式:
<bk-button v-authority="{ permission: hasAuth, actionId: 'host_edit' }">
编辑
</bk-button>
指令功能:
📦 获取完整指令实现:
skill://permission-directive/assets/authority-directive.ts
AuthButton对于需要更多自定义的场景,可封装鉴权按钮组件。
在 vue-router 的 beforeEach 中处理页面级权限。
router.beforeEach(async (to, from, next) => {
const meta = to.meta as any;
if (meta.auth) {
const hasAuth = await checkPageAuth(meta.authAction);
if (!hasAuth) {
next({ name: '403', query: { action: meta.authAction } });
return;
}
}
next();
});
skill://permission-directive/assets/authority-directive.ts根据 SKILL.md 中的 IF-THEN 规则判断是否需要加载