fix : apiKey时区问题更改

This commit is contained in:
likexuan
2022-06-09 14:22:45 +08:00
parent 07a15926fe
commit e6161147ce
2 changed files with 10 additions and 10 deletions

View File

@@ -102,6 +102,7 @@ export default {
this.$refs.apiKeyBoxForm.validate((valid) => { this.$refs.apiKeyBoxForm.validate((valid) => {
if (valid) { if (valid) {
if (this.apiKeyBox.name) { if (this.apiKeyBox.name) {
this.apiKeyBox.expireAt = this.timezoneToUtcTimeStr(this.apiKeyBox.expireAt, 'YYYY-MM-DD HH:mm:ss')
this.$post('sys/apiKey/self', { ...this.apiKeyBox }).then(res => { this.$post('sys/apiKey/self', { ...this.apiKeyBox }).then(res => {
this.prevent_opt.save = false this.prevent_opt.save = false
if (res.code === 200) { if (res.code === 200) {

View File

@@ -40,10 +40,10 @@
{{scope.row[item.prop]?scope.row[item.prop]:'-'}} {{scope.row[item.prop]?scope.row[item.prop]:'-'}}
</template> </template>
<template v-if="item.prop == 'expireAt'"> <template v-if="item.prop == 'expireAt'">
{{scope.row[item.prop]?timeFormates(scope.row[item.prop]):'-'}} {{scope.row[item.prop]?utcTimeToTimezoneStr(scope.row[item.prop]):'-'}}
</template> </template>
<template v-if="item.prop == 'createAt'"> <template v-if="item.prop == 'createAt'">
{{scope.row[item.prop]?timeFormates(scope.row[item.prop]):'-'}} {{scope.row[item.prop]?utcTimeToTimezoneStr(scope.row[item.prop]):'-'}}
</template> </template>
<template v-if="item.prop == 'remark'"> <template v-if="item.prop == 'remark'">
{{scope.row[item.prop]?scope.row[item.prop]:'-'}} {{scope.row[item.prop]?scope.row[item.prop]:'-'}}
@@ -80,7 +80,6 @@
<script> <script>
import { tableCommon } from './systemCommon' import { tableCommon } from './systemCommon'
import table from '@/components/common/mixin/table' import table from '@/components/common/mixin/table'
import bus from '@/libs/bus'
export default { export default {
name: 'apiKeyTable', name: 'apiKeyTable',
props: { props: {
@@ -118,13 +117,13 @@ export default {
} }
}, },
methods: { methods: {
timeFormates (data) { // timeFormates (data) {
if (localStorage.getItem('nz-default-dateFormat')) { // if (localStorage.getItem('nz-default-dateFormat')) {
return bus.timeFormate(new Date(data), localStorage.getItem('nz-default-dateFormat')) // return bus.timeFormate(new Date(data), localStorage.getItem('nz-default-dateFormat'))
} else { // } else {
return bus.timeFormate(new Date(data), 'YYYY-MM-DD HH:mm:ss') // return bus.timeFormate(new Date(data), 'YYYY-MM-DD HH:mm:ss')
} // }
} // }
}, },
created () { created () {
}, },