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