refactor: replace user edition checks with getEditionName method for improved readability

This commit is contained in:
wxg0103 2025-07-04 18:43:34 +08:00
parent fa842b0d13
commit 3722027357
2 changed files with 5 additions and 3 deletions

View File

@ -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)
})
}

View File

@ -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()