import "element3/lib/theme-chalk/index.css"; import { createApp } from "vue"; import Element3 from "element3"; import App from "./App.vue"; import router from "./router"; import store from "./store"; import md5 from "md5"; const app = createApp(App); router.beforeEach(async (to, from, next) => { let id = localStorage.id; if (id) { store.commit("changeLogin", true); if (0 === to.matched.length) { next("/"); } else if (to.path == "/login") { next("/"); } else { next(); } } else { store.commit("changeLogin", false); if (to.path == "/login") { next(); } else { next("/login"); } } }); app.config.globalProperties.check = () => { console.log("check"); }; app.use(router).use(Element3).use(store).mount("#app");