修复了有旧会话信息时,无法自动重置会话的bug

This commit is contained in:
2023-12-16 09:28:50 +00:00
parent d23d0986d6
commit eedf717f10
7 changed files with 23 additions and 15 deletions

View File

@ -0,0 +1,15 @@
var SessionReadyEvent = new Event('SessionReady');
(async () => {
if(session_token==null||outhentication_key==null||operation_count==null){
let tmp_channel=generateRandomString(10);
let ret=await RawRequest('#OpenSession '+tmp_channel);
operation_count=0;
session_token=ret.split('\n')[1].split(' ')[0];
outhentication_key=ret.split('\n')[1].split(' ')[1];
localStorage.setItem("session_token", session_token);
localStorage.setItem("outhentication_key", outhentication_key);
localStorage.setItem("operation_count", operation_count);
}
document.dispatchEvent(SessionReadyEvent);
console.log("Sent event Session Ready");
})();