@@ -22,7 +22,7 @@ interface SocketMessage {
22
22
socket : SocketStore | null ;
23
23
consoleMsg : SpyConsole . DataItem [ ] ;
24
24
consoleMsgTypeFilter : string [ ] ;
25
- consoleMsgKeywordFilter :string ,
25
+ consoleMsgKeywordFilter : string ;
26
26
networkMsg : SpyNetwork . RequestInfo [ ] ;
27
27
systemMsg : SpySystem . DataItem [ ] ;
28
28
connectMsg : string [ ] ;
@@ -36,7 +36,7 @@ interface SocketMessage {
36
36
basicInfo : SpyDatabase . DBInfo [ ] | null ;
37
37
data : SpyDatabase . GetTypeDataItem | null ;
38
38
} ;
39
- initSocket : ( url : string ) => void ;
39
+ initSocket : ( args : Record < string , string > ) => void ;
40
40
setConsoleMsgTypeFilter : ( typeList : string [ ] ) => void ;
41
41
setConsoleMsgKeywordFilter : ( keyword : string ) => void ;
42
42
clearRecord : ( key : string ) => void ;
@@ -47,7 +47,7 @@ export const useSocketMessageStore = create<SocketMessage>((set, get) => ({
47
47
socket : null ,
48
48
consoleMsg : [ ] ,
49
49
consoleMsgTypeFilter : [ ] ,
50
- consoleMsgKeywordFilter :'' ,
50
+ consoleMsgKeywordFilter : '' ,
51
51
networkMsg : [ ] ,
52
52
systemMsg : [ ] ,
53
53
connectMsg : [ ] ,
@@ -66,16 +66,16 @@ export const useSocketMessageStore = create<SocketMessage>((set, get) => ({
66
66
basicInfo : null ,
67
67
data : null ,
68
68
} ,
69
- initSocket : ( room : string ) => {
70
- if ( ! room ) return ;
71
- const address = decodeURIComponent ( room ) . split ( '#' ) [ 0 ] ?? '' ;
69
+ initSocket : ( { address, secret } : Record < string , string > ) => {
72
70
if ( ! address ) return ;
71
+ const roomID = decodeURIComponent ( address ) . split ( '#' ) [ 0 ] ?? '' ;
72
+ if ( ! roomID ) return ;
73
73
74
74
const _socket = get ( ) . socket ;
75
75
if ( _socket ) return ;
76
76
77
77
const [ , protocol ] = resolveProtocol ( ) ;
78
- const url = `${ protocol } ${ API_BASE_URL } /api/v1/ws/room/join?address=${ address } &userId=${ USER_ID } ` ;
78
+ const url = `${ protocol } ${ API_BASE_URL } /api/v1/ws/room/join?address=${ roomID } &userId=${ USER_ID } &secret= ${ secret } ` ;
79
79
80
80
const socket = new SocketStore ( url ) ;
81
81
set ( { socket } ) ;
0 commit comments