import { sys, view } from 'cc'; import { localStorageGet } from '../utils/Helper'; import { LOCAL_ACTIVITY_C, LOCAL_FINGERPRINT_KEY, LOCAL_SIGN } from '../constants/Localkey'; import AppConfig from '../app/AppConfig'; import { AppKernel } from '../app/AppKernel'; function getSign() { return localStorageGet(LOCAL_SIGN, ''); } function getC() { return localStorageGet(LOCAL_ACTIVITY_C, ""); } function getFF() { const platform = AppKernel.platform; const uuid = platform.getUUID(); return uuid; //// h5 平台初始化的时候 使用fingerprintjs写入本地 // return localStorageGet(LOCAL_FINGERPRINT_KEY, ""); } function getBFP() { const platform = AppKernel.platform; const uuid = platform.getUUID(); return uuid; } export function getComParams() { const params: any = {}; params.bfp = getBFP(); const ff = getFF(); if (!!ff) params.ff = ff; params.regionid = AppConfig.ProductName; const sign = getSign(); if (!!sign) params.sign = sign; const c = getC(); if (!!c) params.c = c; const size = view.getVisibleSize(); params._d = sys.isMobile ? 'm' : 'd'; params._t = `${Date.now()}_${Math.round(size.width)}_${Math.round(size.height)}`; // params.pwa = 1; // params.act = act; return params; }