Skip to content

Commit

Permalink
feat: modify asset permission default expired from settings
Browse files Browse the repository at this point in the history
  • Loading branch information
BaiJiangJie committed Nov 1, 2024
1 parent a636bb2 commit 305e44e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/utils/time.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const moment = require('moment')
import { getLangCode } from '@/i18n/utils'
import store from '@/store'

function getTimeUnits(u) {
const units = {
Expand Down Expand Up @@ -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()
}
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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]
Expand Down

0 comments on commit 305e44e

Please sign in to comment.