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

function makeUniqueKey() {
  const isMobile = UserAgent.isMobile() ? "Mobile" : "pc";
  const isAndroid = UserAgent.isAndroid() ? "Android" : "undefined";
  const isIos = UserAgent.isIos() ? "IOS" : "undefined";
  const isWx = UserAgent.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);
}
