更新提示词管理功能,新增提示词创建和删除功能,调整来源类型标识,优化提示词选择界面和表单逻辑

This commit is contained in:
2026-06-09 17:17:32 +08:00
parent 58d5713ec1
commit 10d6ce2b0d
4 changed files with 321 additions and 15 deletions

View File

@@ -11,7 +11,7 @@ export interface PromptItem {
deletedAt?: string | null;
nodeType: string;
prompt: string;
sourceType: number; // 0-自定义 1-公共
sourceType: number; // 1-管理员 2-用户
}
export interface PromptListResponse {
@@ -32,6 +32,23 @@ export interface CreatePromptParams {
sourceType: number;
}
export interface CheckIsSuperAdminResponse {
isSuperAdmin: boolean;
}
export interface CreatePromptResponse {
id?: number | string;
tenantId?: number;
creator?: string;
createdAt?: string;
updater?: string;
updatedAt?: string;
deletedAt?: string | null;
nodeType?: string;
prompt?: string;
sourceType?: number;
}
export interface UpdatePromptParams extends CreatePromptParams {
id: number | string;
}
@@ -92,7 +109,7 @@ export function getMyPromptList(params: PromptListParams) {
* 创建提示词
*/
export function createPrompt(data: CreatePromptParams) {
return request({
return request<CreatePromptResponse>({
url: '/ai-agent/node/prompt/create',
method: 'post',
data,
@@ -120,3 +137,13 @@ export function deletePrompt(id: number | string) {
data: { id },
});
}
/**
* 判断当前用户是否为超级管理员
*/
export function checkIsSuperAdmin() {
return request<CheckIsSuperAdminResponse>({
url: '/admin-go/api/v1/system/user/checkIsSuperAdmin',
method: 'get',
});
}