feat(session): index_tab.js 新增 window._sid() 生成 per-tab session_id(sessionStorage)
This commit is contained in:
parent
65dacbd65d
commit
dc856a9775
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user