diff --git a/CLAUDE.md b/CLAUDE.md index 97b6276..675c767 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -197,6 +197,7 @@ These rules capture long-term repository preferences confirmed by the user and s ### Communication and Risk Rules +- 默认使用中文进行回复、说明、提问与思考表达;如果用户明确要求使用其他语言,再按用户要求切换。 - Before changing code, confirm with the user when a change involves a rewrite, global side effects, unclear requirements, or a second attempt that still has not solved the issue. - After changes, explain what changed, why it was changed that way, and any remaining risks or points worth confirming. - When a requirement still depends on a meaningful assumption, ask the user first instead of silently choosing a direction. diff --git a/src/api/settings/promptManager/index.ts b/src/api/settings/promptManager/index.ts index bde9e3a..6d6f526 100644 --- a/src/api/settings/promptManager/index.ts +++ b/src/api/settings/promptManager/index.ts @@ -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({ 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({ + url: '/admin-go/api/v1/system/user/checkIsSuperAdmin', + method: 'get', + }); +} diff --git a/src/views/settings/creation/component/PromptSelector.vue b/src/views/settings/creation/component/PromptSelector.vue index d9ac241..1694ef4 100644 --- a/src/views/settings/creation/component/PromptSelector.vue +++ b/src/views/settings/creation/component/PromptSelector.vue @@ -16,6 +16,10 @@ 搜索 + + + 新增提示词 + @@ -27,11 +31,20 @@ - + + + + diff --git a/src/views/settings/promptManager/index.vue b/src/views/settings/promptManager/index.vue index 9257f8d..41d23c6 100644 --- a/src/views/settings/promptManager/index.vue +++ b/src/views/settings/promptManager/index.vue @@ -26,8 +26,8 @@ @@ -128,7 +128,7 @@ const nodeOptions = computed(() => { const createForm = reactive({ nodeType: '', prompt: '', - sourceType: 0 as number, + sourceType: 2 as number, }); // 加载节点库 @@ -269,7 +269,7 @@ const cancelCreate = () => { editId.value = null; createForm.nodeType = ''; createForm.prompt = ''; - createForm.sourceType = 0; + createForm.sourceType = 2; }; // 分页