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

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