alibaba / alibaba/ChatUI

点赞点踩功能可以无限次点击

Open
#138 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.4k
Forks
425
PR merge metrics
No merged PRs in 30d

Description

**Version information (版本信息)**
- ChatUI or ChatUI Pro?
- ChatUI Pro
- ChatUI Version:
- 0.3.8
- React Version:
- OS Version:
- Browser Version:

**Describe the bug (描述问题)**
每个回答的点赞点踩功能可以无限次点击

**Steps To Reproduce (重现步骤)**
1. 显示点赞功能
return {
_id: res.data.id,
type: 'card',
content: {
code: 'knowledge',
data: {
text: res.data.answer
}
},
meta: {
evaluable: true, // 是否展示点赞点踩按钮
}
}
2.配置显示交互
feedback: {
// 点赞后出的文本
textOfGood: '感谢您的评价,我们会继续努力的哦!',
// 点踩后出的文本
textOfBad: '很抱歉,给您带来不好的体验,我会继续学习,下次为您提供更好的服务。',
// 点踩后是否显示反馈表单
needFeedback: false,
// 不满意原因列表
options: [
{
value: '我没有得到我想要的答案',
},
{
value: '界面太难用了',
},
{
value: '我不认可这个规则',
},
],
// 原因是否必选
isReasonRequired: true,
// 提交反馈后出的文本
textAfterSubmit: '',
},
3.点赞点踩的请求配置
//点赞点踩接口(可选)
evaluate(data) {
return {
url: 'http://localhost:1234/faq/dialog/evaluate',
data: {
msgId: data.msgId,
evaluateType: data.type,
},
};
},

**Link to minimal reproduction (最小化重现链接)**

**Expected behavior (期望的结果是什么)**
每个回答的点赞点踩功能点击一次后无法再点击

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with a message whose meta.evaluable is true and the configured feedback.evaluate(data) callback. Trace the feedback controls and evaluate request to determine where repeated clicks remain enabled; done means each answer accepts only one like or dislike click, with the existing feedback behavior preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.