Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Alderaan
pan-light
提交
c5e74511
P
pan-light
项目概览
Alderaan
/
pan-light
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
pan-light
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c5e74511
编写于
6月 24, 2019
作者:
P
peterq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
conf
上级
2a56b100
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
103 addition
and
6 deletion
+103
-6
demo/demo-online-front/src/comp/chat/system-msg.vue
demo/demo-online-front/src/comp/chat/system-msg.vue
+39
-0
demo/demo-online-front/src/comp/chat/user-msg.vue
demo/demo-online-front/src/comp/chat/user-msg.vue
+52
-0
server/pan-light-server.yaml
server/pan-light-server.yaml
+12
-6
未找到文件。
demo/demo-online-front/src/comp/chat/system-msg.vue
0 → 100644
浏览文件 @
c5e74511
<
template
>
<div
style=
"margin: 20px;"
>
<div
style=
"text-align: center;"
v-if=
"message.evt === 'join'"
>
<span
class=
"system-tip"
><span
style=
"color: #00a3fb;"
>
{{
user
.
nickname
}}
</span>
加入了群聊
</span>
</div>
<div
style=
"text-align: center;"
v-else-if=
"message.evt === 'leave'"
>
<span
class=
"system-tip"
><span
style=
"color: #00a3fb;"
>
{{
user
.
nickname
}}
</span>
退出了群聊
</span>
</div>
<div
style=
"text-align: center;"
v-else-if=
"message.evt === 'turn'"
>
<span
class=
"system-tip"
>
请
{{
message
.
ticket
.
order
}}
号
<span
style=
"color: #00a3fb;"
>
{{
user
.
nickname
}}
</span>
操作
{{
message
.
ticket
.
slave
}}
</span>
</div>
</div>
</
template
>
<
script
>
export
default
{
props
:
[
'
message
'
],
data
()
{
return
{}
},
computed
:
{
user
()
{
if
(
!
this
.
message
.
sessionId
)
return
{}
return
this
.
$state
.
userSessionInfo
[
this
.
message
.
sessionId
]
}
}
}
</
script
>
<
style
scoped
>
.system-tip
{
padding
:
5px
;
border-radius
:
3px
;
background
:
rgba
(
255
,
255
,
255
,
.2
);
font-size
:
small
;
color
:
#aaa
;
}
</
style
>
demo/demo-online-front/src/comp/chat/user-msg.vue
0 → 100644
浏览文件 @
c5e74511
<
template
>
<div>
<div
v-if=
"!isSelf"
style=
"display: flex; margin-bottom: 20px"
>
<img
:src=
"user.avatar"
style=
"border-radius: 50%;"
alt=
"avatar"
width=
"50"
height=
"50"
>
<div
style=
"display: flex; flex-direction: column;margin-left: 10px;"
>
<span
style=
"font-size: small; color: #aaa"
>
{{
user
.
nickname
}}
</span>
<span
class=
"msg-content"
>
{{
message
.
msg
}}
</span>
</div>
</div>
<div
v-else
style=
"display: flex; margin-bottom: 20px; flex-direction: row-reverse;"
>
<img
:src=
"user.avatar"
style=
"border-radius: 50%;"
alt=
"avatar"
width=
"50"
height=
"50"
>
<div
style=
"display: flex; flex-direction: column;margin-right: 10px; align-items: flex-end"
>
<span
style=
"font-size: small; color: #aaa"
>
{{
user
.
nickname
}}
</span>
<span
class=
"msg-content"
style=
"background: #00aa49;"
>
{{
message
.
msg
}}
</span>
</div>
</div>
</div>
</
template
>
<
script
>
export
default
{
props
:
[
'
message
'
],
data
()
{
return
{}
},
computed
:
{
user
()
{
return
this
.
$state
.
userSessionInfo
[
this
.
message
.
from
]
},
isSelf
()
{
console
.
log
({
a
:
this
.
message
.
from
,
b
:
this
.
$state
.
userSessionInfo
.
self
.
sessionId
})
return
this
.
message
.
from
===
this
.
$state
.
userSessionInfo
.
self
.
sessionId
}
}
}
</
script
>
<
style
scoped
>
.msg-content
{
background
:
white
;
border
:
1px
solid
#ddd
;
padding
:
10px
;
border-radius
:
10px
;
max-width
:
260px
;
display
:
inline-block
;
word-break
:
break-word
;
word-wrap
:
break-word
;
}
</
style
>
server/pan-light-server.yaml
浏览文件 @
c5e74511
Other
:
debug
:
true
app-secret
:
qwertyuiop
mongodb-uri
:
mongodb://super:super@127.0.0.1:27017/admin?maxPoolSize=100
database
:
pan-light
redis
:
addr
:
127.0.0.1:6379
pwd
:
'
'
db
:
2
demo
:
hosts
:
-
name
:
asus-test
password
:
asus-test
-
name
:
asus-home
password
:
PeterQ-is-doomed-to-SucceSS
\ No newline at end of file
-
name
:
asus-test
password
:
asus-test
-
name
:
asus-home
password
:
PeterQ-is-doomed-to-SucceSS
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录