Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
shun peng
/
lufa-ai
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e3730e94
authored
Jul 08, 2025
by
patrick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复登陆信息失效返回错误
parent
88efbb4f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
ruoyi-vue-pro-master-jdk17/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/chat/AiChatMessageController.java
+5
-1
ruoyi-vue-pro-master-jdk17/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatMessageServiceImpl.java
+2
-1
No files found.
ruoyi-vue-pro-master-jdk17/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/chat/AiChatMessageController.java
View file @
e3730e94
...
@@ -109,8 +109,12 @@ public class AiChatMessageController {
...
@@ -109,8 +109,12 @@ public class AiChatMessageController {
@Parameter
(
name
=
"conversationId"
,
required
=
true
,
description
=
"对话编号"
,
example
=
"1024"
)
@Parameter
(
name
=
"conversationId"
,
required
=
true
,
description
=
"对话编号"
,
example
=
"1024"
)
public
CommonResult
<
List
<
AiChatMessageRespVO
>>
getChatMessageListByConversationId
(
public
CommonResult
<
List
<
AiChatMessageRespVO
>>
getChatMessageListByConversationId
(
@RequestParam
(
"conversationId"
)
Long
conversationId
)
{
@RequestParam
(
"conversationId"
)
Long
conversationId
)
{
Long
userId
=
getLoginUserId
();
if
(
userId
==
null
){
throw
exception
(
USER_NOT_LOGIN
);
}
AiChatConversationDO
conversation
=
chatConversationService
.
getChatConversation
(
conversationId
);
AiChatConversationDO
conversation
=
chatConversationService
.
getChatConversation
(
conversationId
);
if
(
conversation
==
null
||
ObjUtil
.
notEqual
(
conversation
.
getUserId
(),
getLoginUserId
()
))
{
if
(
conversation
==
null
||
ObjUtil
.
notEqual
(
conversation
.
getUserId
(),
userId
))
{
return
success
(
Collections
.
emptyList
());
return
success
(
Collections
.
emptyList
());
}
}
List
<
AiChatMessageDO
>
messageList
=
chatMessageService
.
getChatMessageListByConversationId
(
conversationId
);
List
<
AiChatMessageDO
>
messageList
=
chatMessageService
.
getChatMessageListByConversationId
(
conversationId
);
...
...
ruoyi-vue-pro-master-jdk17/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatMessageServiceImpl.java
View file @
e3730e94
...
@@ -156,7 +156,7 @@ public class AiChatMessageServiceImpl implements AiChatMessageService {
...
@@ -156,7 +156,7 @@ public class AiChatMessageServiceImpl implements AiChatMessageService {
chatMessageMapper
.
insert
(
assistantMessage
);
chatMessageMapper
.
insert
(
assistantMessage
);
});
});
}).
doOnError
(
throwable
->
{
}).
doOnError
(
throwable
->
{
log
.
error
(
"[sendChatMessageStream][userId({}) sendReqVO({}) 发生异常]"
,
userId
,
sendReqVO
,
throwable
);
//
log.error("[sendChatMessageStream][userId({}) sendReqVO({}) 发生异常]", userId, sendReqVO, throwable);
// 忽略租户,因为 Flux 异步无法透传租户
// 忽略租户,因为 Flux 异步无法透传租户
// TenantUtils.executeIgnore(() ->
// TenantUtils.executeIgnore(() ->
// chatMessageMapper.updateById(new AiChatMessageDO().setId(assistantMessage.getId()).setContent(throwable.getMessage())));
// chatMessageMapper.updateById(new AiChatMessageDO().setId(assistantMessage.getId()).setContent(throwable.getMessage())));
...
@@ -164,6 +164,7 @@ public class AiChatMessageServiceImpl implements AiChatMessageService {
...
@@ -164,6 +164,7 @@ public class AiChatMessageServiceImpl implements AiChatMessageService {
assistantMessage
.
setContent
(
throwable
.
getMessage
());
assistantMessage
.
setContent
(
throwable
.
getMessage
());
chatMessageMapper
.
insert
(
assistantMessage
);
chatMessageMapper
.
insert
(
assistantMessage
);
});
});
throw
exception
(
ErrorCodeConstants
.
CHAT_STREAM_ERROR
);
}).
onErrorResume
(
error
->
Flux
.
just
(
error
(
ErrorCodeConstants
.
CHAT_STREAM_ERROR
)));
}).
onErrorResume
(
error
->
Flux
.
just
(
error
(
ErrorCodeConstants
.
CHAT_STREAM_ERROR
)));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment