"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const common_vendor = require("./common/vendor.js");
const utils_auth = require("./utils/auth.js");
const stores_permission = require("./stores/permission.js");
const plugins_index = require("./plugins/index.js");
require("./utils/storage.js");
require("./utils/constant.js");
require("./utils/request.js");
require("./stores/user.js");
require("./config.js");
require("./utils/errorCode.js");
require("./utils/common.js");
require("./plugins/tab.js");
require("./plugins/auth.js");
require("./plugins/modal.js");
require("./plugins/xy.js");
require("./plugins/request.js");
require("./plugins/dict.js");
require("./stores/dict.js");
if (!Math) {
  "./pages/login.js";
  "./pages/globalPages/home.js";
  "./pages/xy_system/devices/deviceList.js";
  "./pages/xy_system/devices/deviceDetail.js";
  "./pages/xy_system/devices/deviceNetHistory.js";
  "./pages/xy_system/devices/deviceEvents.js";
  "./pages/xy_system/logs/deviceLogs.js";
  "./pages/xy_system/logs/logFile.js";
  "./pages/xy_merc_be/mercManager/merc.js";
}
const _sfc_main = {
  __name: "App",
  setup(__props) {
    const { proxy } = common_vendor.getCurrentInstance();
    common_vendor.onLaunch(() => {
      initApp();
    });
    function initApp() {
      console.log("初始化应用开始~");
      isUpdate();
      checkLogin();
    }
    async function checkLogin() {
      console.log("检测是否登录开始！");
      if (utils_auth.getToken()) {
        console.log("已登录！");
        await stores_permission.usePermissionStore().GetPermis();
        if (stores_permission.usePermissionStore().permissions_menu && stores_permission.usePermissionStore().permissions_menu.length > 0) {
          {
            proxy.$tab.reLaunch("/pages/globalPages/home");
          }
        } else {
          proxy.$modal.msg("该用户无权限~");
        }
      } else {
        console.log("未登录！");
      }
    }
    function isUpdate() {
      console.log("检测更新开始~");
      const updateManager = common_vendor.index.getUpdateManager();
      updateManager.onCheckForUpdate(function(res) {
        console.log(res.hasUpdate);
      });
      updateManager.onUpdateReady(function() {
        common_vendor.index.showModal({
          title: "更新提示",
          content: "新版本已经准备好，是否重启应用？",
          success(res) {
            if (res.confirm) {
              updateManager.applyUpdate();
            }
          }
        });
      });
      updateManager.onUpdateFailed(function() {
      });
    }
    return () => {
    };
  }
};
const App = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "F:/兴元/开门柜项目/平台端管理系统小程序/src/App.vue"]]);
function createApp() {
  const app = common_vendor.createSSRApp(App);
  app.use(common_vendor.uviewPlus);
  app.use(common_vendor.createPinia());
  app.use(plugins_index.installPlugins);
  return {
    app,
    Pinia: common_vendor.Pinia
  };
}
createApp().app.mount("#app");
exports.createApp = createApp;
