MicroCommunityWeb/src/main.js

31 lines
765 B
JavaScript

import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import i18n from './i18n'
Vue.prototype.hasPrivilege = function(privilegeCode) {
// 这里实现你的权限检查逻辑
// 例如从 Vuex store 或本地存储中获取用户权限列表
const userPrivileges = []
return userPrivileges.includes(privilegeCode)
}
Vue.prototype.toDoc = function(url) {
window.open('http://www.homecommunity.cn/'+url, '_blank')
}
Vue.prototype.$getUser = function() {
let user = JSON.parse(localStorage.getItem('user'))
return user
}
Vue.use(ElementUI)
Vue.config.productionTip = false
new Vue({
router,
i18n,
render: h => h(App)
}).$mount('#app')