Toggle navigation
Toggle navigation
This project
Loading...
Sign in
최시원
/
Singer-Composer
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
devsho
2021-11-25 21:04:11 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
9d86ecd4a3bc51e038d84ecab0dbff25ba7da2b9
9d86ecd4
2 parents
2ad63887
1f86430d
chat visual update
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
5 deletions
app.js
js/chat.js
readme.md
router/register/index.js
app.js
View file @
9d86ecd
...
...
@@ -98,7 +98,7 @@ io.sockets.on('connection', function(socket) {
console
.
log
(
logString
+
socket
.
name
+
' 님이 접속하였습니다.('
+
ip
+
')'
)
/* 모든 소켓에게 전송 */
io
.
sockets
.
emit
(
'update'
,
{
type
:
'connect'
,
name
:
'SERVER'
,
message
:
socket
.
name
+
'님이 접속하였습니다.'
})
io
.
sockets
.
emit
(
'update'
,
{
type
:
'connect'
,
message
:
socket
.
name
+
'님이 접속하였습니다.'
})
}
})
...
...
js/chat.js
View file @
9d86ecd
...
...
@@ -13,12 +13,16 @@ socket.on('update', function(data) {
var
chat
=
document
.
getElementById
(
'chat'
)
var
message
=
document
.
createElement
(
'div'
)
<<<<<<<
HEAD
var
node
;
if
(
data
.
name
!=
"SERVER"
){
node
=
document
.
createTextNode
(
`
${
data
.
name
}
:
${
data
.
message
}
`
)
}
else
{
node
=
document
.
createTextNode
(
`
${
data
.
message
}
`
)
}
=======
var
node
=
document
.
createTextNode
(
`
${
data
.
message
}
`
)
>>>>>>>
1
f86430deee4a2d7a6b101a712358a5552e443ee
var
className
=
''
// 타입에 따라 적용할 클래스를 다르게 지정
...
...
readme.md
View file @
9d86ecd
...
...
@@ -61,10 +61,8 @@ create table board(
>UPDATE board SET idx = @COUNT:=@COUNT+1;
---
### 최종 수정: 2021-11-25
18:48
<br>
### 최종 수정: 2021-11-25
20:24
<br>
### 수정 내용:
0.
사용자-서버 채팅간 여백
0.
채팅 엔터키
1.
채팅 구현
2.
시간 실시간 반영
3.
프로필 사진 추가
...
...
router/register/index.js
View file @
9d86ecd
...
...
@@ -88,7 +88,7 @@ passport.use('local-join', new LocalStrategy({
var
sql
=
{
ID
:
ID
,
password
:
password
,
type
:
req
.
body
.
type
,
nickname
:
req
.
body
.
nickname
};
var
query
=
connection
.
query
(
'insert into userDB set ?'
,
sql
,
function
(
err
,
rows
){
if
(
err
)
throw
err
console
.
log
(
logString
+
"회원가입 알림: 사용자가 추가되었습니다.(
"
+
ID
+
", "
+
req
.
body
.
nickname
+
"
// "
+
ip
+
')'
)
console
.
log
(
logString
+
"회원가입 알림: 사용자가 추가되었습니다.(
{"
+
ID
+
"("
+
req
.
body
.
nickname
+
")}
// "
+
ip
+
')'
)
return
done
(
null
,
{
'ID'
:
ID
,
'nickname'
:
req
.
body
.
nickname
});
})
}
...
...
Please
register
or
login
to post a comment