设置store

This commit is contained in:
李志鹏
2025-10-24 11:47:07 +08:00
parent c1d57f2347
commit 9fff109c77
5 changed files with 79 additions and 28 deletions

View File

@@ -23,7 +23,18 @@ export const useGenerateStore = defineStore({
photoInfo: {
id: "",
url: "",
}
file: null,
},
/** AI魔改信息 */
customizeInfo: {
inputText:"",
tryOnId: "",
tryOnUrl: "",
styleUrl: "",
isRegenerated: "",
isFavorite: false,
},
}
},
getters: {
@@ -65,6 +76,16 @@ export const useGenerateStore = defineStore({
updatePhotoInfo(data: any) {
this.photoInfo.id = data.visitRecordId || ""
this.photoInfo.url = data.defaultImageUrl || ""
this.photoInfo.file = null
},
/** 更新AI魔改信息 */
clearCustomizeInfo(data: any) {
this.customizeInfo.inputText = data.inputText || ""
this.customizeInfo.tryOnId = data.tryOnId || ""
this.customizeInfo.tryOnUrl = data.tryOnUrl || ""
this.customizeInfo.styleUrl = data.styleUrl || ""
this.customizeInfo.isRegenerated = data.isRegenerated || ""
this.customizeInfo.isFavorite = data.isFavorite || ""
},
}
})
})