cc 1 周之前
父节点
当前提交
3dcee1eb15
共有 1 个文件被更改,包括 1 次插入 和 7 次删除
  1. 1 7
      ai-server/src/main/java/com/zsjz/ai/module/agent/controller/AgentChatController.java

+ 1 - 7
ai-server/src/main/java/com/zsjz/ai/module/agent/controller/AgentChatController.java

@@ -47,13 +47,7 @@ public class AgentChatController {
     public ChatAttachmentService.AttachmentVO uploadAttachment(@RequestPart("file") MultipartFile file,
                                                                @RequestParam Long workspaceId,
                                                                @RequestParam(required = false) Long sessionId) {
-        Long userId;
-        try {
-            userId = StpUtil.getLoginIdAsLong();
-        } catch (Exception e) {
-            throw new ServerException(401, "未登录");
-        }
-        return chatAttachmentService.upload(file, userId, workspaceId, sessionId == null ? 0L : sessionId);
+        return chatAttachmentService.upload(file, StpUtil.getLoginIdAsLong(), workspaceId, sessionId == null ? 0L : sessionId);
     }
 
     /**