feat: 完成工作流 Public API 授权闭环
- 新增访问令牌工作流 API 全局授权与 Public Workflow API 权限断言 - 补齐 API Key 执行记录归属、状态查询与下线后不可恢复边界 - 增加管理端接口调用说明与访问令牌授权开关
This commit is contained in:
@@ -33,6 +33,7 @@ interface Entity {
|
||||
expiredAt: Date | null | string;
|
||||
permissionIds: (number | string)[]; // 绑定值:权限 ID 数组
|
||||
knowledgeShareEnabled: boolean;
|
||||
workflowApiEnabled: boolean;
|
||||
id?: number; // 编辑时的主键
|
||||
}
|
||||
|
||||
@@ -51,6 +52,7 @@ const entity = ref<Entity>({
|
||||
expiredAt: null,
|
||||
permissionIds: [],
|
||||
knowledgeShareEnabled: false,
|
||||
workflowApiEnabled: false,
|
||||
});
|
||||
// 加载状态
|
||||
const btnLoading = ref(false);
|
||||
@@ -120,6 +122,7 @@ function getResourcePermissionList() {
|
||||
function createDefaultEntity(row: Partial<Entity> = {}): Entity {
|
||||
const permissionIds = row.permissionIds || [];
|
||||
const knowledgeShareEnabled = Boolean(row.knowledgeShareEnabled);
|
||||
const workflowApiEnabled = Boolean(row.workflowApiEnabled);
|
||||
return {
|
||||
apiKey: '',
|
||||
status: '',
|
||||
@@ -128,6 +131,7 @@ function createDefaultEntity(row: Partial<Entity> = {}): Entity {
|
||||
...row,
|
||||
permissionIds,
|
||||
knowledgeShareEnabled,
|
||||
workflowApiEnabled,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -183,6 +187,7 @@ function closeDialog() {
|
||||
expiredAt: null,
|
||||
permissionIds: [],
|
||||
knowledgeShareEnabled: false,
|
||||
workflowApiEnabled: false,
|
||||
};
|
||||
isAdd.value = true;
|
||||
dialogVisible.value = false;
|
||||
@@ -261,6 +266,12 @@ defineExpose({
|
||||
>
|
||||
{{ $t('sysApiKey.knowledgeSharePermission') }}
|
||||
</ElCheckbox>
|
||||
<ElCheckbox
|
||||
v-model="entity.workflowApiEnabled"
|
||||
class="permission-checkbox"
|
||||
>
|
||||
{{ $t('sysApiKey.workflowApiPermission') }}
|
||||
</ElCheckbox>
|
||||
</div>
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
|
||||
Reference in New Issue
Block a user