fix(canvas): 资源引用 - 校验递归素材并修复断链

This commit is contained in:
ddCat committed 2026-09-24 00:12:53 +08:00
1 parent 5bbd208bef
commit 117fa7d70b
24 files changed
+697 -218

No files matched your search

+3 -2
View File
@@ -293,8 +293,9 @@ func (s *Service) upsertUserCanvasProjectWithHistory(userID string, raw json.Raw
if errors.Is(err, repository.ErrCanvasRevisionConflict) {
return canvasRevisionConflict()
}
if errors.Is(err, repository.ErrCanvasHistoryResourceMissing) {
return kernel.NewAppError(http.StatusConflict, "画布引用的素材已变化,当前内容未被覆盖,请保留草稿并重新加载")
var missing *repository.CanvasHistoryResourceMissingError
if errors.As(err, &missing) {
return canvasResourcesMissingError(missing.References)
}
return err
}