inleft
2022-02-09 9bcb19959eeb9da9bde2561e7278f6d0a55eb151
commit | author | age
9bcb19 1 import store from '@/store'
I 2
3 export function actionToObject (json) {
4   try {
5     return JSON.parse(json)
6   } catch (e) {
7     console.log('err', e.message)
8   }
9   return []
10 }
11
12 /**
13  * 控制按钮是否显示
14  *
15  * @author yubaoshan
16  * @date 2020/06/27 02:34
17  */
18 export function hasBtnPermission (permission) {
19   const myBtns = store.getters.buttons
20   const admintype = store.getters.admintype
21   // eslint-disable-next-line eqeqeq
22   if (admintype == '1') {
23      return true
24   }
25   return myBtns.indexOf(permission) > -1
26 }