mirror of
https://gitee.com/bitdance-team/chrome-extension
synced 2025-10-08 00:45:13 +08:00
style
This commit is contained in:
17
packages/shell-chrome/assets/js/session.js
Normal file
17
packages/shell-chrome/assets/js/session.js
Normal file
@@ -0,0 +1,17 @@
|
||||
chrome.storage.sync.get('sessionid', function ({ sessionid }) {
|
||||
|
||||
if (!sessionid) {
|
||||
sessionid = uuid.v4()
|
||||
console.log(sessionid)
|
||||
chrome.storage.sync.set({
|
||||
'sessionid': sessionid
|
||||
});
|
||||
}
|
||||
|
||||
axios.defaults.headers.common['x-tt-session-v2'] = sessionid
|
||||
|
||||
if (typeof sessionCb === 'function') {
|
||||
sessionCb()
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user