Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
broadcast_cloud
/
web-live
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
2
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fc4d5caf
authored
Dec 21, 2020
by
MichaelJier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
1. 新增直播间心跳传输信息
parent
a3bfbd96
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
1 deletions
+40
-1
.eslintignore
+4
-0
components/view/index.vue
+36
-1
plugins/timer.js
+0
-0
No files found.
.eslintignore
0 → 100644
View file @
fc4d5caf
node_modules
dist
timer.js
\ No newline at end of file
components/view/index.vue
View file @
fc4d5caf
...
@@ -57,12 +57,47 @@ export default {
...
@@ -57,12 +57,47 @@ export default {
isPeep
()
{
isPeep
()
{
const
peep
=
this
.
channelConfig
.
peep
||
{};
const
peep
=
this
.
channelConfig
.
peep
||
{};
return
!!
peep
.
isEnable
;
return
!!
peep
.
isEnable
;
},
token
()
{
return
this
.
$cookie
.
get
(
this
.
tokenKey
)
?
this
.
$cookie
.
get
(
this
.
tokenKey
).
token
||
0
:
0
}
}
},
},
async
mounted
()
{
async
mounted
()
{
this
.
$Bus
.
$on
(
'bus-showLogin'
,
this
.
_toggleLogin
);
this
.
$Bus
.
$on
(
'bus-showLogin'
,
this
.
_toggleLogin
);
this
.
get_userInfo
({
refererId
:
this
.
$route
.
query
.
refererId
});
await
this
.
get_userInfo
({
refererId
:
this
.
$route
.
query
.
refererId
});
this
.
set_nowDate
();
this
.
set_nowDate
();
const
websocketHeartbeat
=
require
(
'@/plugins/timer'
).
default
;
this
.
timer
=
websocketHeartbeat
({
url
:
'ws://47.110.242.138:8081/stats/channel/watchTime'
,
pingTimeout
:
5000
,
pongTimeout
:
5000
,
manualStart
:
false
,
repeatLimit
:
3
,
userInfo
:
{
"msg"
:
""
,
"token"
:
this
.
token
,
"id"
:
this
.
channelInfo
.
id
,
"type"
:
"live"
,
"uin"
:
this
.
channelInfo
.
uin
,
"liveNowStatus"
:
this
.
channelInfo
.
liveNowStatus
},
webworker
:
true
}).
useIt
(
'uuid'
).
useIt
(
'ua'
)
// this.$watch(
// () => {
// return this.$cookie.get(this.tokenKey) ? this.$cookie.get(this.tokenKey).token || 0 : 0
// },
// function(oldVal,newVal){
// console.log(oldVal, newVal)
// }
// )
// 进入5s开始连接
setTimeout
(()
=>
{
this
.
timer
.
createWebSocket
()
})
this
.
timer
.
onMessage
=
function
(
e
)
{
console
.
log
(
`onmessage:
${
e
.
data
}
`
)
}
},
},
methods
:
{
methods
:
{
...
mapActions
({
...
mapActions
({
...
...
plugins/timer.js
0 → 100644
View file @
fc4d5caf
This diff is collapsed.
Click to expand it.
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