<template>
  <Locale>
    <router-view v-slot="{ Component }">
      <component :is="Component" />
    </router-view>
    <div id="dialog"></div>
  </Locale>
</template>

<script setup lang="ts">
import Locale from "@/config/locale.vue";
import { setToken } from "@/store/user";
import { sceneType, show } from "@/store/case";
import { strToParams } from "@/util";
import { ElMessageBox } from "element-plus";
import { browser } from "@/util/browser.ts";
const url = window.location.href.split('?')[1];
const urlWithoutHash = window.location.href.split('#')[0]
const params = strToParams(urlWithoutHash);
if (params.token) {
  setToken(params.token);
}
if(params.power){
  sceneType.value = params.power;
}
if(params.show){
  show.value = params.show == 'true' ? true : false;
}
let version = browser.isGreaterThan('108.0.0')
if(!version){
  window.location.href = './browser.html'
  //   ElMessageBox.alert('当前浏览器不支持', "提示", {
  //   confirmButtonText: "确定",
  //   type: "warning",
  //   callback: () => {
  //     window.location.href = './browser.html'
  //   },
  // })
}
console.log("getBrowserInfo", params, browser.isGreaterThan('128.0.0'));

</script>
