refactor: jdmc license

This commit is contained in:
Bai
2026-03-13 17:36:01 +08:00
parent e48b195774
commit 0a8b536a71
3 changed files with 35 additions and 2 deletions

View File

@@ -26,12 +26,29 @@ export default {
'currentUser'
]),
licenseMsg() {
if (this.expireMsg) {
if (this.jdmcMsg) {
return this.jdmcMsg
} else if (this.expireMsg) {
return this.expireMsg
} else {
return this.reachLimitsMsg
}
},
jdmcMsg() {
if (!this.publicSettings['XPACK_ENABLED'] || !this.$hasPerm('settings.change_license')) {
return false
}
if (this.licenseData.message === 'license_expired') {
return this.$t('LicenseExpired')
}
if (this.licenseData.message === 'license_maintenance_expired') {
return this.$t('LicenseMaintenanceExpired')
}
if (this.licenseData.message === 'license_will_expire') {
return this.$t('LicenseWillExpire')
}
return false
},
expireMsg() {
if (!this.publicSettings['XPACK_ENABLED'] || !this.$hasPerm('settings.change_license')) {
return false

View File

@@ -2,7 +2,7 @@
<div>
<slot name="globalNotification">
<SqlQueryTip v-if="debug " />
<LicenseRelatedTip v-else />
<LicenseRelatedTip />
<PasswordExpireTip />
</slot>
<div class="page-heading">

View File

@@ -1,6 +1,9 @@
import i18n from '@/i18n/i18n'
import empty from '@/layout/empty'
import { BASE_URL } from '@/utils/common/index'
import store from '@/store'
const getSettings = () => store.state.settings.publicSettings || {}
const Setting = () => import('@/views/settings/index')
const globalSubmenu = () => import('@/layout/globalOrg.vue')
@@ -576,6 +579,19 @@ export default {
path: '/settings/license',
name: 'License',
component: () => import('@/views/settings/License'),
beforeEnter: (_to, _from, next) => {
const settings = getSettings()
if (settings?.JDMC_ENABLED) {
let url = `${BASE_URL}/jdmc/appManagement/appAuth`
if (process.env.NODE_ENV !== 'production') {
url = url.replace('9528', '9898')
}
window.open(url, '_blank')
next(false)
} else {
next()
}
},
meta: {
title: i18n.t('License'),
icon: 'license',