mirror of
https://github.com/jumpserver/lina.git
synced 2026-05-18 13:45:01 +00:00
refactor: jdmc license
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<slot name="globalNotification">
|
||||
<SqlQueryTip v-if="debug " />
|
||||
<LicenseRelatedTip v-else />
|
||||
<LicenseRelatedTip />
|
||||
<PasswordExpireTip />
|
||||
</slot>
|
||||
<div class="page-heading">
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user