feat: 后台一键刷新飞书缓存
- feishu_service.py: FeishuKnowledgeService 新增 clear_cache() 方法 - admin_settings.py: 新增 POST /admin/feishu/cache/clear API - api.ts: 前端封装 clearFeishuCache API - App.vue: Agent管理页面新增'刷新飞书缓存'按钮 管理员更新飞书文档后,点击按钮即可清空服务端内存缓存, 客户端下次提问时会重新读取最新内容。
This commit is contained in:
@@ -912,6 +912,15 @@ function clearAgentPreview() {
|
||||
];
|
||||
}
|
||||
|
||||
async function clearFeishuCache() {
|
||||
try {
|
||||
const result = await api.clearFeishuCache();
|
||||
ElMessage.success(result.message || `已清空 ${result.cleared} 条缓存`);
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e.message || "刷新缓存失败");
|
||||
}
|
||||
}
|
||||
|
||||
async function searchChats() {
|
||||
chats.value = await api.chats(buildChatQuery());
|
||||
}
|
||||
@@ -1163,6 +1172,7 @@ function buildChatQuery() {
|
||||
<div class="actions">
|
||||
<el-button type="primary" @click="savePrompt">保存 Agent 提示词</el-button>
|
||||
<el-button @click="clearAgentPreview">清空预览</el-button>
|
||||
<el-button type="warning" @click="clearFeishuCache">刷新飞书缓存</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user