From ec5551f70e61a43fabce90da94686a28b6a83102 Mon Sep 17 00:00:00 2001 From: yin5th <541304803@qq.com> Date: Wed, 24 Nov 2021 14:37:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=93=E5=AD=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/handle.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/handle.js b/js/handle.js index 9d850f6..74ef235 100644 --- a/js/handle.js +++ b/js/handle.js @@ -48,15 +48,15 @@ function getFirstEventKeyword(name) { // 设置领舞 name=姓名 time=有效期 单位秒 function setLeader(name, time) { - localStorage.setItem('leader', name) - localStorage.setItem('leader_end_at', (new Date).getTime()/1000 + time) + sessionStorage.setItem('leader', name) + sessionStorage.setItem('leader_end_at', (new Date).getTime()/1000 + time) } // 获取领舞人信息 function getLeader() { let res = [] - res['name'] = localStorage.getItem('leader') ? localStorage.getItem('leader') : '' - res['time'] = localStorage.getItem('leader_end_at') ? localStorage.getItem('leader_end_at') : 0 + res['name'] = sessionStorage.getItem('leader') ? sessionStorage.getItem('leader') : '' + res['time'] = sessionStorage.getItem('leader_end_at') ? sessionStorage.getItem('leader_end_at') : 0 return res } @@ -158,7 +158,7 @@ function receiveMessage(event) let random2 = Math.floor(Math.random() + 0.5) // 获取领舞信息 - let leaderInfo = localStorage.getItem('leader') + let leaderInfo = sessionStorage.getItem('leader') let isLeader = data.uname == leaderInfo ? 1 : 0 // 给弹幕加上随机事件