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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user