feat: modify asset permission default expired from settings

This commit is contained in:
Bai
2024-11-01 18:21:12 +08:00
committed by Bryan
parent a636bb2037
commit 305e44ea1c
2 changed files with 6 additions and 4 deletions

View File

@@ -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()
}

View File

@@ -11,7 +11,6 @@
<script>
import { GenericCreateUpdatePage } from '@/layout/components'
import AssetSelect from '@/components/Apps/AssetSelect'
import { getDayFuture } from '@/utils/time'
import AccountFormatter from './components/AccountFormatter'
import { AllAccount } from '../const'
import ProtocolsSelect from '@/components/Form/FormFields/AllOrSpec.vue'
@@ -32,9 +31,6 @@ export default {
}
return {
initial: {
is_active: true,
date_start: new Date().toISOString(),
date_expired: getDayFuture(25550, new Date()).toISOString(),
nodes: nodesInitial,
assets: assetsInitial,
accounts: [AllAccount]