diff --git a/src/stores/modules/generate.ts b/src/stores/modules/generate.ts index 183d34f..bd5e612 100644 --- a/src/stores/modules/generate.ts +++ b/src/stores/modules/generate.ts @@ -32,6 +32,7 @@ export const useGenerateStore = defineStore({ /** AI魔改信息 */ customizeInfo: { inputText: '', + count: 0, tryOnId: '', tryOnUrl: '', @@ -108,6 +109,7 @@ export const useGenerateStore = defineStore({ /** 清空 AI魔改信息 */ clearCustomizeInfo() { this.customizeInfo.inputText = '' + this.customizeInfo.count = 0 this.customizeInfo.tryOnId = '' this.customizeInfo.tryOnUrl = '' this.customizeInfo.styleUrl = '' diff --git a/src/views/Workshop/customize.vue b/src/views/Workshop/customize.vue index 672b124..99dc668 100644 --- a/src/views/Workshop/customize.vue +++ b/src/views/Workshop/customize.vue @@ -40,10 +40,11 @@ isRegenerated: 1, prompt: customizeInfo.inputText } - if (generateStore.customerPhotoId) data["customerPhotoId"] = generateStore.customerPhotoId + if (generateStore.customerPhotoId && customizeInfo.count === 0) data["customerPhotoId"] = generateStore.customerPhotoId loading.value = true generateTryOnEffect(data) .then((res:any) => { + customizeInfo.count++ customizeInfo.tryOnId = res.tryOnId customizeInfo.tryOnUrl = res.tryOnUrl customizeInfo.styleUrl = res.styleUrl