Browse Source

feat: 账号管理 - 获取用户数据看板权限

zhengxy 2 years ago
parent
commit
9af4734acb

+ 2 - 0
project/src/assets/config/interface_api.js

@@ -366,6 +366,8 @@ var api = {
366 366
   customerAlerts_updateConfStatus: "/api/abnormalAccount/updateConfStatus", // 客服异常预警 - 启用/禁用
367 367
   customerAlerts_confDetail: "/api/abnormalAccount/confDetail", // 客服异常预警 - 规则详情
368 368
 
369
+  user_dataBoardAuth: "/api/userPermission/exportAuth", // 账号管理 - 用户数据看板权限
370
+
369 371
 };
370 372
 
371 373
 export { api };

+ 1 - 0
project/src/components/dataBoard/accountTrends.vue

@@ -272,6 +272,7 @@ export default {
272 272
     },
273 273
   },
274 274
   created () {
275
+    console.log('created => ')
275 276
     this.initTableHeight()
276 277
     this.handleGetChart()
277 278
     this.handleGetSummaryList()

+ 16 - 0
project/src/router/permission.js

@@ -8,6 +8,19 @@ import { allRouter } from '@/router/allRouter'
8 8
 import Vue from "vue";
9 9
 import store from '@/store.js'// 引入store
10 10
 
11
+const handleGetUserDataBoardAuth = async () => {
12
+  const params = {}
13
+  const { data: res = {} } = await axios.get(api.BASEURL + api.user_dataBoardAuth, { params })
14
+  if (res.errno == 0 && res.rst) {
15
+    store.commit('setDataBoardAuth', {
16
+      adq_auth: res.rst.adq_auth,
17
+      mp_auth: res.rst.mp_auth,
18
+      can_export: res.rst.can_export,
19
+    })
20
+    console.log('store dataBoardAuth => ', JSON.parse(JSON.stringify(store.state.dataBoardAuth)))
21
+  }
22
+}
23
+
11 24
 function permissionInit (cb) {
12 25
   function copy (obj) {//深拷贝
13 26
     var newobj = obj.constructor === Array ? [] : {};
@@ -72,6 +85,9 @@ function permissionInit (cb) {
72 85
           }
73 86
         })
74 87
         router.addRoutes(routes)
88
+
89
+        // 获取用户数据看板权限
90
+        handleGetUserDataBoardAuth()
75 91
       }
76 92
       cb ? cb() : ''
77 93
     }).catch(err => {

+ 13 - 2
project/src/store.js

@@ -15,7 +15,12 @@ const state = {  //要设置的全局访问的state对象
15 15
   batchStatus: 0,//批量加好友添加状态,数据总览给添加客户传参(兄弟组件)
16 16
   batchTime: [],//批量加好友时间,,数据总览给添加客户传参(兄弟组件)
17 17
   data_side_list: [],
18
-  helper_side_list: []
18
+  helper_side_list: [],
19
+  dataBoardAuth: { // 数据看板权限
20
+    adq_auth: false, // adq权限
21
+    mp_auth: false, // mp权限
22
+    can_export: false, // 是否可导出
23
+  },
19 24
 };
20 25
 const getters = {
21 26
   // getIsCollapse (state) {
@@ -31,7 +36,13 @@ const mutations = {
31 36
   },
32 37
   setLoginid (state, data) {
33 38
     state.loginid = data
34
-  }
39
+  },
40
+  // 设置数据看板权限
41
+  setDataBoardAuth(state, { adq_auth = false, mp_auth = false, can_export = false }) {
42
+    state.dataBoardAuth.adq_auth = adq_auth
43
+    state.dataBoardAuth.mp_auth = mp_auth
44
+    state.dataBoardAuth.can_export = can_export
45
+  },
35 46
 }
36 47
 const actions = {
37 48
   profileInit ({ commit, state }, obj) {