From 5f298ae97828bd9eca504bbbdcc8de2cbfdd0017 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 21 Mar 2023 09:24:09 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-2718=20fix=EF=BC=9Alicense=20=E5=88=B0?= =?UTF-8?q?=E6=9C=9F=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=87=86?= =?UTF-8?q?=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/page/config/system/license.vue | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/nezha-fronted/src/components/page/config/system/license.vue b/nezha-fronted/src/components/page/config/system/license.vue index 1ecd09c7a..3d6e7ee86 100644 --- a/nezha-fronted/src/components/page/config/system/license.vue +++ b/nezha-fronted/src/components/page/config/system/license.vue @@ -213,14 +213,27 @@ export default { this.licenseMark = res.data.license this.licenseList = res.data.license.hasp this.licenseList.production_date = bus.timeFormate(bus.computeTimezone(this.licenseList.production_date * 1000)) - this.licenseList.feature.map(e => { + let expData = {} + this.licenseList.feature.forEach(e => { if (e.id === '20001') { - this.expData = e - this.expData.license.exp_date = bus.timeFormate(bus.computeTimezone(this.expData.license.exp_date * 1000)) - this.stateItem = bus.timeFormate(bus.computeTimezone(e.license.time_start * 1000)) - this.endItem = bus.timeFormate(bus.computeTimezone(e.license.time_start * 1000)) + bus.timeFormate(bus.computeTimezone(e.license.end_time * 1000)) + if (!expData.id) { + expData = e + } + if (expData.license) { + if (expData.license.license_type != 'expiration') { + expData.license.license_type = e.license.license_type + } + if (expData.license.exp_date < e.license.exp_date) { + expData.license.exp_date = e.license.exp_date + } + if (e.license.license_type == 'trial' && (e.license.time_start + e.license.end_time > expData.license.exp_date)) { + expData.license.exp_date = e.license.time_start + e.license.end_time + } + } } }) + expData.license.exp_date = bus.timeFormate(bus.computeTimezone(expData.license.exp_date * 1000)) + this.expData = expData } else { this.$message.error(res.msg) }