From 92ad4ed42ef716370f481bbc6ff1ea13aa8ce7ce Mon Sep 17 00:00:00 2001 From: ZhuangYumin Date: Fri, 15 Dec 2023 12:15:54 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E5=88=B7=E6=96=B0session=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/Web/communication.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frontend/Web/communication.js b/frontend/Web/communication.js index 380edf4..521e9aa 100644 --- a/frontend/Web/communication.js +++ b/frontend/Web/communication.js @@ -92,4 +92,16 @@ async function GetMyPrivilege() { let ret = await RawRequest("#Who "+session_token+" InfoQuery "+outhentication_key); return parseInt(ret.split('\n')[1].split(' ')[1]); +} + +async function RefreshSession() +{ + 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); } \ No newline at end of file