perf(licenseTip): 管理员有license过期提醒,其它用户无license过期提醒

This commit is contained in:
jym503558564
2020-10-14 14:35:15 +08:00
committed by Orange
parent 5f60130952
commit 98f5f38694

View File

@@ -20,9 +20,13 @@ export default {
},
computed: {
...mapGetters([
'publicSettings'
'publicSettings',
'currentUser'
]),
isExpire() {
if (this.currentUser.role !== 'Admin') {
return false
}
const intervalDays = this.getIntervalDays(this.licenseData.date_expired)
if (intervalDays < 0) {
return this.$t('setting.LicenseExpired')
@@ -34,7 +38,7 @@ export default {
}
},
mounted() {
if (this.publicSettings.XPACK_ENABLED) {
if (this.publicSettings.XPACK_ENABLED && this.currentUser.role === 'Admin') {
this.$axios.get('/api/v1/xpack/license/detail').then(res => {
this.licenseData = res
}).finally(() => {