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;