From 30d2c83860640721fdb8bb9e46305bc5e5e60f61 Mon Sep 17 00:00:00 2001 From: GouJ Date: Thu, 24 Sep 2026 23:53:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E9=81=93=E5=85=B7=E8=BA=AB=E4=BB=BD=E6=AF=8D?= =?UTF-8?q?=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../subject-identity/useSubjectIdentity.ts | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/features/subject-identity/useSubjectIdentity.ts b/src/features/subject-identity/useSubjectIdentity.ts index f211de2..8bada1c 100644 --- a/src/features/subject-identity/useSubjectIdentity.ts +++ b/src/features/subject-identity/useSubjectIdentity.ts @@ -326,6 +326,36 @@ export function useSubjectIdentity() { await detail.refresh() } + /** Scene / Prop 人工确认母版时原子完成 Anchor 切换与 Identity 锁定。 */ + async function confirmStableAnchor(imageId: string) { + const image = images.value.find(item => item.id === imageId) + if ( + detailBlocked.value || + (subject.value?.module !== 'scene' && subject.value?.module !== 'prop') || + !identity.value || + !image || + !canBeAnchor(image) + ) + return + const subjectId = subject.value.id + const identityId = identity.value.id + await runOperation(projectId.value, `确认 ${subject.value.name} 身份母版`, async () => { + const result = await subjectIdentityApi.confirmStableAnchor(subjectId, imageId) + if ( + !result || + result.identityId !== identityId || + result.subjectId !== subjectId || + !result.isLocked || + result.anchor.id !== imageId || + !result.anchor.isAnchor || + result.anchor.identityId !== identityId || + !canBeAnchor(result.anchor) + ) + throw new Error('接口未确认身份母版与身份锁定,请刷新核对。') + }) + await Promise.all([detail.refresh(), catalog.refresh()]) + } + /** Character 确认选角必须原子切换 Anchor 并锁定 Identity。 */ async function confirmCasting(imageId: string) { const image = images.value.find(item => item.id === imageId) @@ -398,6 +428,7 @@ export function useSubjectIdentity() { generateImage, generateCastingCandidate, setAnchor, + confirmStableAnchor, confirmCasting } }