refactor: replace user edition checks with getEditionName method for improved readability
This commit is contained in:
parent
fa842b0d13
commit
3722027357
@ -108,9 +108,9 @@ const onChange = (file: any) => {
|
||||
|
||||
const editionText = computed(() => {
|
||||
if (!user) return '-'
|
||||
if (user.isPE()) {
|
||||
if (user.getEditionName() === 'PE') {
|
||||
return t('layout.about.edition.professional')
|
||||
} else if (user.isEE()) {
|
||||
} else if (user.getEditionName() === 'EE') {
|
||||
return t('layout.about.edition.enterprise')
|
||||
} else {
|
||||
return t('layout.about.edition.community')
|
||||
@ -119,7 +119,6 @@ const editionText = computed(() => {
|
||||
function getLicenseInfo() {
|
||||
licenseApi.getLicense(loading).then((res: any) => {
|
||||
licenseInfo.value = res.data?.license
|
||||
console.log(licenseInfo.value)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -96,6 +96,9 @@ const useUserStore = defineStore('user', {
|
||||
isEE() {
|
||||
return this.edition == 'EE' && this.license_is_valid
|
||||
},
|
||||
getEditionName() {
|
||||
return this.edition
|
||||
},
|
||||
changeUserType(num: number, token?: string) {
|
||||
this.userType = num
|
||||
const login = useLoginStore()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user