Fix(云灵AI):[#5351]【送礼预设流程】在最后一步,快速连续点击两次「下一步」按钮,触发重复提交请求,对话页出现两条加载中的 AI 回复
This commit is contained in:
@@ -53,7 +53,8 @@ export const chatMixinsV2 = {
|
|||||||
exceptionConfig: {
|
exceptionConfig: {
|
||||||
model_exception: '您提的问题未能理解,云灵思想跑偏啦,重新整理一下问题或者重新提问,让云灵再试试!',
|
model_exception: '您提的问题未能理解,云灵思想跑偏啦,重新整理一下问题或者重新提问,让云灵再试试!',
|
||||||
voice_exception: ''
|
voice_exception: ''
|
||||||
}
|
},
|
||||||
|
giftStepLoading: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -217,6 +218,7 @@ export const chatMixinsV2 = {
|
|||||||
handleLoginFailure()
|
handleLoginFailure()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (this.loading) return
|
||||||
const prompt = params.prompt
|
const prompt = params.prompt
|
||||||
if (params.init !== 1) {
|
if (params.init !== 1) {
|
||||||
_this.chatMessageList.push({
|
_this.chatMessageList.push({
|
||||||
@@ -796,6 +798,7 @@ export const chatMixinsV2 = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
finishGiftSteps() {
|
finishGiftSteps() {
|
||||||
|
if (this.giftStepLoading || this.loading) return
|
||||||
const selectedSteps = []
|
const selectedSteps = []
|
||||||
this.giftBuyOptions.forEach(step => {
|
this.giftBuyOptions.forEach(step => {
|
||||||
if (step.type === 'option_card') {
|
if (step.type === 'option_card') {
|
||||||
@@ -822,6 +825,7 @@ export const chatMixinsV2 = {
|
|||||||
})
|
})
|
||||||
console.log(selectedSteps)
|
console.log(selectedSteps)
|
||||||
uni.showLoading()
|
uni.showLoading()
|
||||||
|
this.giftStepLoading = true
|
||||||
getGiftRecommendPrompt(selectedSteps).then(res => {
|
getGiftRecommendPrompt(selectedSteps).then(res => {
|
||||||
const { success, data } = res
|
const { success, data } = res
|
||||||
if (success) {
|
if (success) {
|
||||||
@@ -833,6 +837,7 @@ export const chatMixinsV2 = {
|
|||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
this.giftStepLoading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user