mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-01 05:53:43 +08:00
feat(chat): 修复仅非管理员设置根据用户 ID查询聊天记录
- 在 ChatMessageServiceImpl 类中,仅当用户不是超级管理员时,才自动设置消息的用户 ID,确保了超级管理员可以查看对话聊天
This commit is contained in:
@@ -48,7 +48,10 @@ public class ChatMessageServiceImpl implements IChatMessageService {
|
||||
if(!LoginHelper.isLogin()){
|
||||
return TableDataInfo.build();
|
||||
}
|
||||
bo.setUserId(LoginHelper.getUserId());
|
||||
// 只有非管理员才自动设置为自己的 ID
|
||||
if (!LoginHelper.isSuperAdmin()) {
|
||||
bo.setUserId(LoginHelper.getUserId());
|
||||
}
|
||||
LambdaQueryWrapper<ChatMessage> lqw = buildQueryWrapper(bo);
|
||||
Page<ChatMessageVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
|
||||
Reference in New Issue
Block a user