diff --git a/src/layout/components/Page/LicenseRelatedTip.vue b/src/layout/components/Page/LicenseRelatedTip.vue index f90b4c3b6..4b09401cb 100644 --- a/src/layout/components/Page/LicenseRelatedTip.vue +++ b/src/layout/components/Page/LicenseRelatedTip.vue @@ -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 diff --git a/src/layout/components/Page/PageHeading.vue b/src/layout/components/Page/PageHeading.vue index c20938ecf..615a389ec 100644 --- a/src/layout/components/Page/PageHeading.vue +++ b/src/layout/components/Page/PageHeading.vue @@ -2,7 +2,7 @@
- +
diff --git a/src/router/settings/index.js b/src/router/settings/index.js index 63c8e16a5..088313359 100644 --- a/src/router/settings/index.js +++ b/src/router/settings/index.js @@ -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',