|
@@ -167,6 +167,7 @@ const selectedStyle = ref('');
|
|
|
const styleList = ['电影写真', '中国风', '卡通', '动漫', '素描', '像素风格'];
|
|
const styleList = ['电影写真', '中国风', '卡通', '动漫', '素描', '像素风格'];
|
|
|
const conversationInProgress = ref(false);
|
|
const conversationInProgress = ref(false);
|
|
|
const modelId = ref(0)
|
|
const modelId = ref(0)
|
|
|
|
|
+const POINT_COST = 100
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
try {
|
|
try {
|
|
@@ -269,7 +270,7 @@ const sendMessage = async() => {
|
|
|
}
|
|
}
|
|
|
if (conversationInProgress.value) return
|
|
if (conversationInProgress.value) return
|
|
|
|
|
|
|
|
- if (!await ensureAiPoint(100)) return
|
|
|
|
|
|
|
+ if (!await ensureAiPoint(POINT_COST)) return
|
|
|
|
|
|
|
|
// 如果正在录音,先停止录音
|
|
// 如果正在录音,先停止录音
|
|
|
if (isVoiceRecording.value) {
|
|
if (isVoiceRecording.value) {
|
|
@@ -316,7 +317,7 @@ const sendMessage = async() => {
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
const loadingIdx = imageAllList.value.findIndex(m => m.loading === true)
|
|
const loadingIdx = imageAllList.value.findIndex(m => m.loading === true)
|
|
|
if (loadingIdx !== -1) imageAllList.value.splice(loadingIdx, 1)
|
|
if (loadingIdx !== -1) imageAllList.value.splice(loadingIdx, 1)
|
|
|
- Message().error('创建图片生成任务失败,请稍后重试')
|
|
|
|
|
|
|
+ Message().error('创建图片生成任务失败,请稍后重试,本次未消耗积分')
|
|
|
} finally {
|
|
} finally {
|
|
|
conversationInProgress.value = false;
|
|
conversationInProgress.value = false;
|
|
|
}
|
|
}
|
|
@@ -367,11 +368,11 @@ const refreshWatchImages = async () => {
|
|
|
|
|
|
|
|
if (image.status === AiImageStatusEnum.FAIL) {
|
|
if (image.status === AiImageStatusEnum.FAIL) {
|
|
|
const errorMsg = parseArkErrorMessage(image.errorMessage)
|
|
const errorMsg = parseArkErrorMessage(image.errorMessage)
|
|
|
- const failMsg = { id: genMsgId(), type: 'ai', content: `生成图片失败:${errorMsg}` }
|
|
|
|
|
|
|
+ const failMsg = { id: genMsgId(), type: 'ai', content: `生成图片失败:${errorMsg}(消耗的 ✦${POINT_COST} 积分已退回)` }
|
|
|
imageAllList.value.push(failMsg)
|
|
imageAllList.value.push(failMsg)
|
|
|
cacheDataHistoryList.value.push(failMsg)
|
|
cacheDataHistoryList.value.push(failMsg)
|
|
|
localStorage.setItem(props.cacheDataHistoryKey, JSON.stringify(cacheDataHistoryList.value))
|
|
localStorage.setItem(props.cacheDataHistoryKey, JSON.stringify(cacheDataHistoryList.value))
|
|
|
- Message().error(`图片生成失败:${errorMsg}`)
|
|
|
|
|
|
|
+ Message().error(`图片生成失败:${errorMsg},消耗的 ✦${POINT_COST} 积分已退回`)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|