import Vue from "vue"; import ElementUI from "element-ui"; import "element-ui/lib/theme-chalk/index.css"; import "es6-promise/auto"; import 'quill/dist/quill.core.css' // import styles import 'quill/dist/quill.snow.css' // for snow theme import App from "./App.vue"; import RootRouter from "./routers"; import store from "./store"; import "~/assets/css/common.css"; import i18n from "./lang"; import CustomComponent from "./components"; import vuefunc from "./utils/vuefunc"; import "./permission"; import EventService,{LOGIN,LOGOUT} from "~/service/EventService"; import Api from "./service/Api"; window.SUCCESS = "AAAAAA"; Vue.use(ElementUI, { size: "small", i18n: (key, value) => i18n.t(key, value) }); Vue.use(CustomComponent); Vue.use(vuefunc); function resetCache(){ window.GLOBAL_CACHE = {PAGEID_CACHE:new Set()}; } //初始化cache resetCache(); //登录后重置 EventService.on(LOGIN,()=>{ resetCache(); }); //退出后重置 EventService.on(LOGOUT,()=>{ resetCache(); }); Vue.prototype.$Api = Api new Vue({ el: "#app", store, i18n, router: RootRouter, render: (h) => h(App), });