mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-17 13:53:41 +00:00
Merge pull request #156 from MuSan-Li/feature_20250804_fix_bug
feat: 优化空指针bug&格式化代码&初始化用户知识库角色配置
This commit is contained in:
@@ -162,7 +162,7 @@ tenant:
|
||||
- sys_user_role
|
||||
|
||||
knowledge-role:
|
||||
enable: false
|
||||
enable: true
|
||||
|
||||
# MyBatisPlus配置
|
||||
# https://baomidou.com/config/
|
||||
|
||||
@@ -328,6 +328,7 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||
insertUserRole(user, true);
|
||||
// 新增用户与岗位管理
|
||||
insertUserPost(user, true);
|
||||
// 更新知识库角色信息
|
||||
SysUser sysUser = MapstructUtils.convert(user, SysUser.class);
|
||||
// 防止错误更新后导致的数据误删除
|
||||
int flag = baseMapper.updateById(sysUser);
|
||||
|
||||
@@ -26,6 +26,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* dify 聊天管理
|
||||
*
|
||||
@@ -65,7 +67,7 @@ public class DifyServiceImpl implements IChatService {
|
||||
|
||||
// 获取conversationId
|
||||
ChatSessionVo sessionInfo = chatSessionService.queryById(chatRequest.getSessionId());
|
||||
if (StrUtil.isNotBlank(sessionInfo.getConversationId())) {
|
||||
if (Objects.nonNull(sessionInfo) && StrUtil.isNotBlank(sessionInfo.getConversationId())) {
|
||||
message.setConversationId(sessionInfo.getConversationId());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user