// 生成的唯一标识
import QuickStorage from '@/utils/QuickStorage'
import UserAgents from '@/utils/UserAgents'

function makeUniqueKey() {
  const isMobile = UserAgents.isMobile ? 'Mobile' : 'pc'
  const isAndroid = UserAgents.isAndroid ? 'Android' : 'undefined'
  const isIos = UserAgents.isIos ? 'IOS' : 'undefined'
  const isWx = UserAgents.isWx ? 'MicroMessenger' : 'undefined'
  const getTime = new Date().getTime()
  const random = Math.floor(Math.random(100000) * 100000 + 100000)
  return `${isMobile}_${isAndroid}_${isIos}_${isWx}_${getTime}_${random}`
}
if (!QuickStorage.localGet('DEVICE_ID')) {
  const uniqueKey = makeUniqueKey()

  QuickStorage.localSet('DEVICE_ID', uniqueKey)
}
