From 305e44ea1c82fee49368cd10990102e069a25612 Mon Sep 17 00:00:00 2001 From: Bai Date: Fri, 1 Nov 2024 18:21:12 +0800 Subject: [PATCH] feat: modify asset permission default expired from settings --- src/utils/time.js | 6 ++++++ .../perms/AssetPermission/AssetPermissionCreateUpdate.vue | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/utils/time.js b/src/utils/time.js index 5ea23107d..21f851ffb 100644 --- a/src/utils/time.js +++ b/src/utils/time.js @@ -1,5 +1,6 @@ const moment = require('moment') import { getLangCode } from '@/i18n/utils' +import store from '@/store' function getTimeUnits(u) { const units = { @@ -124,3 +125,8 @@ export function formatDate(inputTime) { // return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second return y + '-' + m + '-' + d + 'T' + h + ':' + minute + ':' + second } + +export function getDefaultExpiredDays() { + const years = store.getters.publicSettings.DEFAULT_EXPIRED_YEARS + return getDayFuture(years * 365, new Date()).toISOString() +} diff --git a/src/views/perms/AssetPermission/AssetPermissionCreateUpdate.vue b/src/views/perms/AssetPermission/AssetPermissionCreateUpdate.vue index 430e03685..53260d666 100644 --- a/src/views/perms/AssetPermission/AssetPermissionCreateUpdate.vue +++ b/src/views/perms/AssetPermission/AssetPermissionCreateUpdate.vue @@ -11,7 +11,6 @@