copy.js 566 B

1234567891011121314151617181920212223242526272829
  1. // 获取应用权限
  2. checkAuth (appname,auth) {
  3. // console.log(appname)
  4. try {
  5. let _haveAuth = true
  6. let modules = JSON.parse(sessionStorage.getItem('active_modules'))
  7. let apps = modules.apps
  8. // 获取当前应用数据
  9. let active_apps = apps.filter(item => {
  10. return item.name === appname
  11. })
  12. // 获取当前应用权限
  13. let auth_list = active_apps[0].meta.auth
  14. // 判断是否拥有权限
  15. _haveAuth = auth_list.some(item=>item.option === auth)
  16. return _haveAuth
  17. } catch (error) {
  18. }
  19. },