feat: 优化403权限错误提示\n\n当用户没有dify:dataset:manage权限时,\n执行更新/删除操作返回403,\n前端显示友好的"权限不足"提示,\n而不是通用的"更新失败,请稍后重试"\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nCo-Authored-By: Claude <noreply@anthropic.com>

This commit is contained in:
2025-12-08 15:32:09 +08:00
parent 547633bf38
commit 209f57a5b7
+6 -1
View File
@@ -255,7 +255,12 @@ export function useAreaDatasetConfig(): UseAreaDatasetConfigReturn {
}
} catch (error: any) {
console.error('更新知识库绑定失败:', error);
message.error('更新失败,请稍后重试');
// 检查是否为403权限不足错误
if (error?.response?.status === 403 || error?.status === 403) {
message.error('权限不足:您没有编辑知识库绑定的权限');
} else {
message.error('更新失败,请稍后重试');
}
return false;
} finally {
setSubmitLoading(false);