We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5849997 + e79599b commit a15ed6bCopy full SHA for a15ed6b
BE/apps/api-server/src/modules/connection/connection.controller.ts
@@ -26,7 +26,8 @@ export class ConnectionController {
26
@UseGuards(AuthGuard('jwt'))
27
async getConnection(@Query() queryDto: ConnectionQueryDto, @User() user: UserDto) {
28
const { type, id } = queryDto;
29
-
+ console.log('type:', type);
30
+ console.log('id:', id);
31
switch (type) {
32
case 'connection':
33
return await this.connectionService.getConnection(id as string, user.id);
BE/apps/api-server/src/modules/connection/connection.service.ts
@@ -25,7 +25,11 @@ export class ConnectionService {
25
async createGuestConnection() {
const connectionId = uuidv4();
- await this.GeneralRedis.hset(connectionId, { type: 'guest' });
+ await Promise.all([
+ this.GeneralRedis.hset(connectionId, { type: 'guest', aiCount: 0, title: '제목없음' }),
+ this.GeneralRedis.set(`mindmapState:${connectionId}`, JSON.stringify({})),
+ this.GeneralRedis.set(`content:${connectionId}`, ''),
+ ]);
return { connectionId, role: 'owner' };
34
}
35
@@ -39,7 +43,8 @@ export class ConnectionService {
39
43
40
44
async setConnection(mindmapId: number, userId: number) {
41
45
const role = await this.userService.getRole(userId, mindmapId);
42
- if (!role) {
46
+ this.logger.log(`role: ${role}`);
47
+ if (role === undefined) {
48
throw new ForbiddenException('권한이 없습니다.');
49
50
BE/apps/api-server/src/modules/user/user.controller.ts
@@ -1,4 +1,4 @@
1
-import { Controller, Get, UseGuards } from '@nestjs/common';
+import { Controller, Get, UnauthorizedException,UseGuards } from '@nestjs/common';
2
import { UserService } from './user.service';
3
import { AuthGuard } from '@nestjs/passport';
4
import { User } from '../../decorators';
@@ -10,6 +10,10 @@ export class UserController {
10
@Get('info')
11
12
async getUserInfo(@User() user) {
13
- return await this.userService.getUserInfo(user.id);
+ try {
14
+ return await this.userService.getUserInfo(user.id);
15
+ } catch {
16
+ throw new UnauthorizedException();
17
+ }
18
19
client/index.html
@@ -1,5 +1,5 @@
<!doctype html>
-<html lang="en">
+<html lang="ko">
<head>
<meta charset="UTF-8" />
5
<link rel="icon" type="image/svg+xml" href="/logo.png" />
client/src/api/index.ts
@@ -58,6 +58,8 @@ instance.interceptors.response.use(
58
originalRequest.headers["Authorization"] = `Bearer ${newAccessToken.accessToken}`;
59
return instance(originalRequest);
60
} catch (error) {
61
+ await signOut();
62
+ useConnectionStore.getState().logout();
63
return Promise.reject(error);
64
65
client/src/konva_mindmap/utils/nodeAttrs.ts
@@ -10,7 +10,7 @@ export const TEXT_WIDTH = (depth: number) => NODE_DEFAULT_SIZE * 2 - depth * 18;
//CONNECTED_LINE
export const CONNECTED_LINE_FROM = (depth: number) => NODE_DEFAULT_SIZE - depth * 7 + 10;
-export const CONNECTED_LINE_TO = (depth: number) => NODE_DEFAULT_SIZE - depth * 7 + 5;
+export const CONNECTED_LINE_TO = (depth: number) => NODE_DEFAULT_SIZE - depth * 7 + 3;
//TEXT
export const TEXT_FONT_SIZE = 16;
client/src/store/createAuthSlice.ts
@@ -22,6 +22,7 @@ export const createAuthSlice: StateCreator<ConnectionStore, [], [], AuthSlice> =
22
logout: () => {
23
set({ email: null, name: null, token: "" });
24
get().resetOwnedMindMap();
+ location.href = "/";
},
setUser: (email: string, name: string, id: number) => {
client/src/store/createSharedSlice.ts
@@ -20,6 +20,7 @@ export const createSharedSlice: StateCreator<ConnectionStore, [], [], SharedSlic
20
get().token
21
? get().addOwnedMindMap(newMindMapConnectionId)
: get().addOwnedMindMapForGuest(newMindMapConnectionId);
+ get().connectSocket(newMindMapConnectionId);
navigate(`/mindmap/${newMindMapConnectionId}?mode=${targetMode}`);
throw error;
client/src/store/createSocketSlice.ts
@@ -103,7 +103,6 @@ export const createSocketSlice: StateCreator<ConnectionStore, [], [], SocketSlic
103
if (socket) socket.disconnect();
104
const response = await createMindmap();
105
const connectionId = response.data.connectionId;
106
- get().connectSocket(connectionId);
107
return connectionId;
108
109
client/src/utils/formData.ts
@@ -1,7 +1,12 @@
export function audioFormData(file: File, mindmapId: string, connectionId: string) {
const formData = new FormData();
- formData.append("aiAudio", file);
+
+ const encodedFileName = encodeURIComponent(file.name);
+ const encodedFile = new File([file], encodedFileName, { type: file.type });
6
7
+ formData.append("aiAudio", encodedFile);
8
formData.append("mindmapId", mindmapId);
9
formData.append("connectionId", connectionId);
return formData;
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments