import validUA from "@/utils/ua";
if (!validUA) {
  alert(
    "请选择Chrome内核版本大于80的浏览器，最新版的Chrome浏览器(推荐)和360浏览器(极速和安全均可)满足要求。"
  );
  location.href = "about:blank";
}
import "./styles/global.css";
import "./styles/page.less";
import { createApp } from "vue";
import { createPinia } from "pinia";
import { initMarkStore } from "@/store/store";
import App from "./App.vue";
import router from "@/router";
import filters from "@/filters";
// import Antd from "ant-design-vue";
// import "ant-design-vue/dist/antd.css";
// vite-plugin-components 不能引入message的style
import "ant-design-vue/es/message/style/css.js";

import QmButton from "@/components/QmButton.vue";
import QmDialog from "@/components/QmDialog.vue";

// if(process.env.NODE_ENV)
// console.log(import.meta.env.DEV);
const app = createApp(App);
app.use(router);
app.use(createPinia());
// app.use(Antd);
app.config.globalProperties.$filters = filters;

app.component("QmButton", QmButton);
app.component("QmDialog", QmDialog);

/**
 * @description pinia限制，初始化Store, 必须在use pinia插件实例之后。所以在此执行初始化， 此方法调用之后, Store初始化完成
 * @notice 在初始化完成之前，store为null , 请勿在初始化完成之前，直接使用store的方法或属性
 */
initMarkStore();

if (import.meta.env.DEV && window.localStorage.getItem("dev_simple")) {
  await import("./devLogin")
    .then((m) => {
      return m.initLogin();
    })
    .then(() => {
      app.mount("#app");
    });
} else {
  app.mount("#app");
}
