mirror of
https://gitee.com/bitdance-team/chrome-extension
synced 2025-01-31 15:30:25 +08:00
18 lines
356 B
JavaScript
18 lines
356 B
JavaScript
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()
|
|
}
|
|
})
|
|
|