Blame view

src/main.js 1.63 KB
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
1
2
3
4
5
6
  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'
0e3df9ef   wuxw   优化物业账号下切换小区功能
7
8
  import {getCommunityName,getCommunityId} from '@/api/community/communityApi'
  
f92fd6ac   wuxw   开发我的小区下的功能
9
10
11
12
13
14
  // 验证全局脚本是否正确加载
  console.log('检查全局脚本加载状态:')
  console.log('Qs 库:', typeof window.Qs !== 'undefined' ? '已加载' : '未加载')
  if (typeof window.Qs !== 'undefined') {
    console.log('Qs 版本:', window.Qs.VERSION || '未知版本')
  }
48ea9c43   wuxw   巡检开发完成
15
  
0e3df9ef   wuxw   优化物业账号下切换小区功能
16
17
18
19
20
21
22
  Vue.prototype.getCommunityId = function(){
    return getCommunityId()
  }
  Vue.prototype.getCommunityName = function(){
    return getCommunityName()
  }
  
ebc1053d   wuxw   加入运营员工详情功能
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  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版正在开发中
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
  }
  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')