Blame view

src/main.js 1.44 KB
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
1
2
3
4
5
  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'
1231aa27   wuxw   移动端图片
6
  //import 'formiojs/dist/formio.full.min.css'
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
7
  import i18n from './i18n'
0e3df9ef   wuxw   优化物业账号下切换小区功能
8
9
  import {getCommunityName,getCommunityId} from '@/api/community/communityApi'
  
f92fd6ac   wuxw   开发我的小区下的功能
10
  // 验证全局脚本是否正确加载
48ea9c43   wuxw   巡检开发完成
11
  
0e3df9ef   wuxw   优化物业账号下切换小区功能
12
13
14
15
16
17
18
  Vue.prototype.getCommunityId = function(){
    return getCommunityId()
  }
  Vue.prototype.getCommunityName = function(){
    return getCommunityName()
  }
  
ebc1053d   wuxw   加入运营员工详情功能
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  Vue.prototype.hasPrivilege = function(_privaleges) {
    // 确保 _privaleges 是数组,如果不是则转换为数组
    const privilegesToCheck = Array.isArray(_privaleges) ? _privaleges : [_privaleges];
    
    // 从本地存储获取用户权限
    let userPrivileges = localStorage.getItem('hc_staff_privilege');
    
    // 如果存在用户权限,则转换为数组
    if (userPrivileges) {
      userPrivileges = userPrivileges.split(',');
    } else {
      // 如果没有权限数据,直接返回 false
      return false;
    }
    
    // 检查用户是否有任一所需权限
    return privilegesToCheck.some(item => userPrivileges.includes(item));
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
  }
  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')