perf(许可): 许可过期提示

This commit is contained in:
fit2cloud-chenyw 2023-07-20 12:06:24 +08:00
parent 78cc58929b
commit 4e8e7d7934
4 changed files with 42 additions and 32 deletions

View File

@ -626,7 +626,8 @@ export default {
status: 'Authorization status', status: 'Authorization status',
valid: 'Valid', valid: 'Valid',
invalid: 'Invalid', 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: { member: {
create: 'Add members', create: 'Add members',

View File

@ -626,7 +626,8 @@ export default {
status: '授權狀態', status: '授權狀態',
valid: '有效', valid: '有效',
invalid: '無效', invalid: '無效',
expired: '已過期' expired: '已過期',
expired_msg: 'License已過期過期時間{0}為了不影響企業版功能的使用建議您更新License'
}, },
member: { member: {
create: '添加成員', create: '添加成員',

View File

@ -625,7 +625,8 @@ export default {
status: '授权状态', status: '授权状态',
valid: '有效', valid: '有效',
invalid: '无效', invalid: '无效',
expired: '已过期' expired: '已过期',
expired_msg: 'License已过期过期时间{0}为了不影响企业版功能的使用建议您更新License'
}, },
member: { member: {
create: '添加成员', create: '添加成员',

View File

@ -1,9 +1,18 @@
<template> <template>
<div <div
v-if="!licValidate && licStatus !== 'no_record'" v-if="!licValidate && licStatus !== 'no_record' && !tipClosed"
class="lic" class="lic_tips"
> >
<strong>{{ $t(licMsg) }}</strong> <el-alert
class="lic_alert"
:title="$t(licMsg)"
type="warning"
show-icon
center
@close="closeTip"
/>
</div> </div>
</template> </template>
@ -20,9 +29,7 @@ export default {
} }
}, },
computed: { computed: {
/* theme() {
return this.$store.state.settings.theme
}, */
licValidate() { licValidate() {
return this.$store.state.lic.validate return this.$store.state.lic.validate
}, },
@ -30,40 +37,40 @@ export default {
return this.$store.state.lic.licStatus || '' return this.$store.state.lic.licStatus || ''
}, },
licMsg() { 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 return this.$store.state.lic.licMsg ? ('license.' + this.$store.state.lic.licMsg) : null
},
tipClosed() {
return localStorage.getItem('lic_closed')
} }
}, },
mounted() { mounted() {
// this.validate()
}, },
methods: { methods: {
// validate() { closeTip() {
// validateLic().then(res => { localStorage.setItem('lic_closed', true)
// 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)
// })
// }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.lic_tips {
.lic { position: absolute;
height: 24px; z-index: 2000;
background-color: #c92100; position:absolute;
color: #fff; top: 0;left:0;right:0;
text-align: center; margin: auto;
/* padding: 6px 11px; */ }
position: fixed; .lic_alert ::v-deep .el-icon-close{
z-index: 1002; top: 16px !important;
top: 0; right: 10px !important;
width: 100%; }
}
</style> </style>