From dc856a9775f3eb7f6b840699ca6b24ec0fce383d Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 24 Aug 2026 18:32:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(session):=20index=5Ftab.js=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20window.=5Fsid()=20=E7=94=9F=E6=88=90=20per-tab=20se?= =?UTF-8?q?ssion=5Fid(sessionStorage)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/index_tab.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wwwroot/index_tab.js b/wwwroot/index_tab.js index 96ef03d..1db7636 100644 --- a/wwwroot/index_tab.js +++ b/wwwroot/index_tab.js @@ -1,5 +1,14 @@ // pipeline-app 首页 TabPanel 动态 tab 支持 // 由 HTML shell 自动加载(configuredServer.get_js_files 收集 wwwroot 下 .js) + +// 每个浏览器 tab 一个 session_id(sessionStorage 隔离),用于多 tab 项目上下文隔离 +window._sid = function(){ + var sid = null; + try { sid = sessionStorage.getItem('pipeline_sid'); } catch(e){} + if(!sid){ sid = 's' + Date.now().toString(36) + Math.random().toString(36).slice(2,10); try{ sessionStorage.setItem('pipeline_sid', sid); }catch(e){} } + return sid; +}; + (function(){ if (typeof bricks === 'undefined' || !bricks.TabPanel) return; if (bricks.TabPanel.prototype._dyn_patched) return;