去除冗余代码

master
yin5th 2021-11-24 21:00:13 +08:00
parent 8f393a4080
commit a2d696e5c8
1 changed files with 5 additions and 4 deletions

View File

@ -93,7 +93,8 @@ function dancer(val){
// 接受消息处理
function receiveMessage(event)
{
console.log(event.data, '接受信息')
// console.log(event.data, '接受弹幕')
// 我们能信任信息来源吗?
if (event.origin !== "https://live.bilibili.com") {
return false
@ -112,6 +113,7 @@ function receiveMessage(event)
return false
}
adminList = ['内有猛犬小心','热心市民阿狄呐','流域_墨绿绿'];
adminList = ['yin5th','热心市民阿狄呐','流域_墨绿绿'];
// adminList = ['饺子吃肉肉'];
// 大航海列表
if (adminList.length > 0) {
@ -155,15 +157,14 @@ function receiveMessage(event)
// custom.js中 每条弹幕的处理 放到了此处
// -------------------- 每条弹幕处理 begin -----------------------
let random2 = Math.floor(Math.random() + 0.5)
// 获取领舞信息
let leaderInfo = sessionStorage.getItem('leader')
let isLeader = data.uname == leaderInfo ? 1 : 0
let dm = {text: data.danmaku, uid: data.uid, uname: data.uname,
event: getEvent(data.danmaku),
is_new: isNew, is_admin: 0, is_exit: random2, is_leader: isLeader}
is_new: isNew, is_admin: 0, is_leader: isLeader}
console.log(data.danmaku, '弹幕')
let leader = {
uid: 0, uname: leaderInfo, text: '', event: ''
}