软件安装时间和证书安装时间,使用 `yyyy-MM-dd HH:mm:ss.SSS` 格式,而不是时间戳。

pull/292/head
王良 2024-04-11 10:23:25 +08:00
parent 80f5943c52
commit 661d135012
1 changed files with 12 additions and 2 deletions

View File

@ -114,7 +114,6 @@
import lodash from 'lodash'
import setupCa from '../components/setup-ca'
import DsContainer from '../components/container'
const backend = require('../../bridge/api/backend')
export default {
name: 'Index',
@ -245,6 +244,17 @@ export default {
openSetupCa () {
this.setupCa.visible = true
},
getDateTimeStr () {
const date = new Date() // Date
const year = date.getFullYear() //
const month = String(date.getMonth() + 1).padStart(2, '0') // 0
const day = String(date.getDate()).padStart(2, '0') //
const hours = String(date.getHours()).padStart(2, '0') //
const minutes = String(date.getMinutes()).padStart(2, '0') //
const seconds = String(date.getSeconds()).padStart(2, '0') //
const milliseconds = String(date.getMilliseconds()).padStart(3, '0') //
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}.${milliseconds}`
},
async handleCaSetuped () {
console.log('this.config.server.setting.rootCaFile.certPath', this.config.server.setting.rootCaFile.certPath)
await this.$api.shell.setupCa({ certPath: this.config.server.setting.rootCaFile.certPath })
@ -254,7 +264,7 @@ export default {
//
rootCa.setuped = true
//
rootCa.setupTime = backend.getDateTimeStr()
rootCa.setupTime = this.getDateTimeStr()
//
rootCa.desc = '根证书已安装'
// noTip