feat(knowledge): add retry endpoint and 20-char text name limit

Add POST /api/tenant/knowledge/items/retry/:id to re-queue failed parse
tasks, plus a 20-rune cap on text item names with matching frontend
validation. Wires the retry button into the knowledge table with a
colored status tag for clearer state feedback.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-01 20:19:08 +08:00
parent c1f07bfb65
commit 39ef1a6b7f
6 changed files with 203 additions and 10 deletions
+3
View File
@@ -703,6 +703,9 @@ export const knowledgeApi = {
removeItem(id: number) {
return apiClient.remove<null>(`/api/tenant/knowledge/items/${id}`);
},
retryItem(id: number) {
return apiClient.post<KnowledgeItem, null>(`/api/tenant/knowledge/items/retry/${id}`, null);
},
};
export const imagesApi = {
+1
View File
@@ -53,6 +53,7 @@ const errorMessageMap: Record<string, string> = {
keyword_exists: "关键词已存在",
keyword_limit_reached: "关键词数量已达当前套餐上限",
question_limit_reached: "当前关键词下的问题数量已达上限",
knowledge_text_name_too_long: "文本名称不能超过 20 个字",
brand_not_found: "品牌不存在或已删除",
keyword_not_found: "关键词不存在或已删除",
publish_cover_required: "当前选择的平台要求上传封面图,请先上传封面图",