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(() => {
|
const editionText = computed(() => {
|
||||||
if (!user) return '-'
|
if (!user) return '-'
|
||||||
if (user.isPE()) {
|
if (user.getEditionName() === 'PE') {
|
||||||
return t('layout.about.edition.professional')
|
return t('layout.about.edition.professional')
|
||||||
} else if (user.isEE()) {
|
} else if (user.getEditionName() === 'EE') {
|
||||||
return t('layout.about.edition.enterprise')
|
return t('layout.about.edition.enterprise')
|
||||||
} else {
|
} else {
|
||||||
return t('layout.about.edition.community')
|
return t('layout.about.edition.community')
|
||||||
@ -119,7 +119,6 @@ const editionText = computed(() => {
|
|||||||
function getLicenseInfo() {
|
function getLicenseInfo() {
|
||||||
licenseApi.getLicense(loading).then((res: any) => {
|
licenseApi.getLicense(loading).then((res: any) => {
|
||||||
licenseInfo.value = res.data?.license
|
licenseInfo.value = res.data?.license
|
||||||
console.log(licenseInfo.value)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -96,6 +96,9 @@ const useUserStore = defineStore('user', {
|
|||||||
isEE() {
|
isEE() {
|
||||||
return this.edition == 'EE' && this.license_is_valid
|
return this.edition == 'EE' && this.license_is_valid
|
||||||
},
|
},
|
||||||
|
getEditionName() {
|
||||||
|
return this.edition
|
||||||
|
},
|
||||||
changeUserType(num: number, token?: string) {
|
changeUserType(num: number, token?: string) {
|
||||||
this.userType = num
|
this.userType = num
|
||||||
const login = useLoginStore()
|
const login = useLoginStore()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user