const.js
683 Bytes
const GLOBAL_STORAGE_KEY = (() => {
const isDEV = location.href.includes('dev=1')
const DEVELOPMENT = 'DEVELOPMENT'
const PRODUCTION = 'PRODUCTION'
return `UNDEFINED__${ isDEV ? DEVELOPMENT : PRODUCTION }__2.7.1__COMMON__LOCAL__KEY__`
})()
const GLOBAL_TOKEN = (() => {
const ls = createStorage({ storage: localStorage })
/**
* @description user info
* @type {{JWT_TOKEN: {value: string}}}
*/
const common = ls.get(GLOBAL_STORAGE_KEY)
return common.JWT_TOKEN.value
})()
const GLOBAL_WS_URL = (() => {
const { host, href } = location
const reg = /^https/
return `${ reg.test(href) ? 'wss' : 'ws' }://${ host }/api/ws/plugins/telemetry?token=${ GLOBAL_TOKEN }`
})()