forked from github/dataease
perf(许可): 许可过期提示
This commit is contained in:
parent
78cc58929b
commit
4e8e7d7934
@ -626,7 +626,8 @@ export default {
|
||||
status: 'Authorization status',
|
||||
valid: 'Valid',
|
||||
invalid: 'Invalid',
|
||||
expired: 'Expired'
|
||||
expired: 'Expired',
|
||||
expired_msg: 'license has expired since {0}. It is recommended to update the license, which does not affect the use of enterprise version functions'
|
||||
},
|
||||
member: {
|
||||
create: 'Add members',
|
||||
|
@ -626,7 +626,8 @@ export default {
|
||||
status: '授權狀態',
|
||||
valid: '有效',
|
||||
invalid: '無效',
|
||||
expired: '已過期'
|
||||
expired: '已過期',
|
||||
expired_msg: 'License已過期,過期時間:{0},為了不影響企業版功能的使用,建議您更新License'
|
||||
},
|
||||
member: {
|
||||
create: '添加成員',
|
||||
|
@ -625,7 +625,8 @@ export default {
|
||||
status: '授权状态',
|
||||
valid: '有效',
|
||||
invalid: '无效',
|
||||
expired: '已过期'
|
||||
expired: '已过期',
|
||||
expired_msg: 'License已过期,过期时间:{0},为了不影响企业版功能的使用,建议您更新License'
|
||||
},
|
||||
member: {
|
||||
create: '添加成员',
|
||||
|
@ -1,9 +1,18 @@
|
||||
<template>
|
||||
|
||||
<div
|
||||
v-if="!licValidate && licStatus !== 'no_record'"
|
||||
class="lic"
|
||||
v-if="!licValidate && licStatus !== 'no_record' && !tipClosed"
|
||||
class="lic_tips"
|
||||
>
|
||||
<strong>{{ $t(licMsg) }}</strong>
|
||||
<el-alert
|
||||
class="lic_alert"
|
||||
:title="$t(licMsg)"
|
||||
type="warning"
|
||||
show-icon
|
||||
center
|
||||
@close="closeTip"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -20,9 +29,7 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
/* theme() {
|
||||
return this.$store.state.settings.theme
|
||||
}, */
|
||||
|
||||
licValidate() {
|
||||
return this.$store.state.lic.validate
|
||||
},
|
||||
@ -30,40 +37,40 @@ export default {
|
||||
return this.$store.state.lic.licStatus || ''
|
||||
},
|
||||
licMsg() {
|
||||
if (this.$store.state.lic?.licMsg?.includes('expired')) {
|
||||
const message = this.$store.state.lic.licMsg
|
||||
const exp = message.substring(message.indexOf('since ') + 6, message.indexOf(','))
|
||||
return this.$t('license.expired_msg').replace('{0}', exp)
|
||||
}
|
||||
return this.$store.state.lic.licMsg ? ('license.' + this.$store.state.lic.licMsg) : null
|
||||
},
|
||||
tipClosed() {
|
||||
return localStorage.getItem('lic_closed')
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
mounted() {
|
||||
// this.validate()
|
||||
},
|
||||
methods: {
|
||||
// validate() {
|
||||
// validateLic().then(res => {
|
||||
// this.lic = true
|
||||
// this.$store.dispatch('lic/setValidate', true)
|
||||
// }).catch((e) => {
|
||||
// this.msg = e.response.data.message
|
||||
// this.lic = false
|
||||
// this.$store.dispatch('lic/setValidate', false)
|
||||
// })
|
||||
// }
|
||||
closeTip() {
|
||||
localStorage.setItem('lic_closed', true)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.lic {
|
||||
height: 24px;
|
||||
background-color: #c92100;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
/* padding: 6px 11px; */
|
||||
position: fixed;
|
||||
z-index: 1002;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.lic_tips {
|
||||
position: absolute;
|
||||
z-index: 2000;
|
||||
position:absolute;
|
||||
top: 0;left:0;right:0;
|
||||
margin: auto;
|
||||
}
|
||||
.lic_alert ::v-deep .el-icon-close{
|
||||
top: 16px !important;
|
||||
right: 10px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user