Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds-front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
beyond-clouds-front
Commits
8a93db70
Commit
8a93db70
authored
Feb 22, 2020
by
yanju
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'message-config' into 'master'
样式优化 See merge request pigbigbig/beyond-clouds-front!107
parents
c351cdb7
61be7206
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
7 deletions
+44
-7
components/pc/pageHeader.vue
+42
-4
plugins/websocket.js
+2
-3
No files found.
components/pc/pageHeader.vue
View file @
8a93db70
<
template
>
<div
class=
"bc-layout-container-header"
>
<notifications
class=
"message-tip-box"
/>
<div
class=
"nuxt-progress"
v-if=
"progressShow"
></div>
<div
class=
"container-header"
v-if=
"!showDetailHead"
>
<div
class=
"header-center"
>
...
...
@@ -131,7 +132,6 @@
<div
class=
"click-top"
v-if=
"showToTop"
@
click=
"clickToTop"
>
<div
class=
"click-top__triangle"
></div>
</div>
<notifications/>
</div>
</
template
>
...
...
@@ -211,18 +211,17 @@
},
sockets
:
{
connect
(
data
)
{
console
.
log
(
'connect.'
)
this
.
$notify
({
title
:
'连接消息'
,
text
:
'websocket连接成功'
,
type
:
'success'
});
},
push_event
(
data
)
{
console
.
log
(
data
)
this
.
$notify
({
title
:
'新消息'
,
text
:
JSON
.
stringify
(
data
),
type
:
'success'
duration
:
2000
});
}
},
...
...
@@ -391,6 +390,45 @@
<
style
lang=
"scss"
>
.bc-layout-container-header
{
.message-tip-box
{
//
Style
of
the
notification
itself
position
:
fixed
;
z-index
:
9999
;
top
:
10px
!important
;
right
:
6px
!important
;
.vue-notification-wrapper
{
margin-bottom
:
10px
;
.vue-notification
{
color
:
#333333
;
background-color
:
#F4F8FA
;
border
:
1px
solid
#eeeeee
;
border-radius
:
6px
;
opacity
:
.9
;
transition
:
all
.3s
;
.notification-title
{
//
Style
for
title
line
padding
:
2px
6px
;
}
.notification-content
{
padding
:
2px
6px
;
}
}
&
.my-type
{
/*
Style for specific type of notification, will be applied when you
call notification with "type" parameter:
this.$notify({ type: 'my-type', message: 'Foo' })
*/
}
}
}
.nuxt-progress
{
position
:
fixed
;
top
:
0
;
...
...
plugins/websocket.js
View file @
8a93db70
...
...
@@ -9,14 +9,13 @@ export default function ({ app: { router }, store }) {
const
auth
=
store
.
state
.
auth
;
if
(
auth
.
authenticated
)
{
console
.
log
(
"检测到用户已登录,正在初始化websocket连接."
)
const
socket
=
new
VueSocketIO
({
Vue
.
use
(
new
VueSocketIO
({
debug
:
true
,
connection
:
socketio
(
'http://api.opensource.yundingshuyuan.com'
,
{
query
:
'token='
+
auth
.
token
}),
options
:
{
path
:
"/socket.io"
}
})
Vue
.
use
(
socket
)
}))
}
}
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment