// 生成的唯一标识
import QuickStorage from '@/plugins/QuickStorage/index'
import UserAgent from '@/plugins/UserAgent/index'

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

    QuickStorage.localSet('DEVICE_ID',uniqueKey)
}