2021-09-02 11:04:14 +08:00
|
|
|
import store from '@/store'
|
|
|
|
|
2021-08-11 15:44:50 +08:00
|
|
|
export function actionToObject (json) {
|
|
|
|
try {
|
|
|
|
return JSON.parse(json)
|
|
|
|
} catch (e) {
|
|
|
|
console.log('err', e.message)
|
|
|
|
}
|
|
|
|
return []
|
|
|
|
}
|
2021-09-02 11:04:14 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 控制按钮是否显示
|
|
|
|
*/
|
|
|
|
export function hasBtnPermission (permission) {
|
|
|
|
const myBtns = store.getters.buttons
|
2021-09-11 17:15:52 +08:00
|
|
|
if (myBtns.indexOf('*:*:*') > -1) {
|
2021-09-02 11:04:14 +08:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
return myBtns.indexOf(permission) > -1
|
|
|
|
}
|