You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tanghe-report/report-ui/src/mixins/access.js

41 lines
799 B
JavaScript

import { getToken, getAccessUser, hasPermission } from '@/utils/auth'
export default {
data () {
return {
}
},
computed: {
operator: function () {
return this.getUser.loginName
},
operatorText: function () {
return `${this.getUser.realName}[${this.getUser.loginName}]`
},
operatorToken: function (){
return getToken()
},
getUser: function () {
let user = getAccessUser()
if (user != null) {
return user;
} else {
return {};
}
},
opAuthorities () {
return this.getUser == null ? [] : this.getUser.authorities
}
},
created () {
},
mounted () {
},
destroyed () {
},
methods: {
hasPermission (permissionStr) {
return hasPermission(permissionStr)
},
}
}