1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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),
});