2024-06-06 13:58:58: merge [main:94936000280c72ce43ef30f2a36a36333115dd62];
This commit is contained in:
1 parent
e8dfc2e552
commit
031a92db3f
17 files changed
+171
-97
No files matched your search
@@ -113,11 +113,6 @@ const TokenContent = ({ id }: TokenPropTypes) => {
|
||||
}
|
||||
|
||||
const columns: ColumnsType<ApplicationTokenType> = [
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'appId',
|
||||
key: 'appId'
|
||||
},
|
||||
{
|
||||
title: 'Токен',
|
||||
dataIndex: 'token',
|
||||
@@ -135,28 +130,24 @@ const TokenContent = ({ id }: TokenPropTypes) => {
|
||||
return <div>{formatTime}</div>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Срок действия',
|
||||
dataIndex: 'expireTime',
|
||||
key: 'expireTime',
|
||||
render: (value) => {
|
||||
const time = dayjs.duration(value).humanize()
|
||||
if (value > 0) {
|
||||
return <div>{time}</div>
|
||||
}
|
||||
return <div>Отсутствует</div>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Истекает',
|
||||
dataIndex: 'expireTime',
|
||||
key: 'expireTime',
|
||||
render: (value, record) => {
|
||||
const formatTime = dayjs(record.createdAt)
|
||||
.add(record.expireTime)
|
||||
.format(dateFormats.fullFormat)
|
||||
|
||||
return value > 0 ? <span>{formatTime}</span> : <span> Никогда </span>
|
||||
if (value === -1) {
|
||||
return <span>Никогда</span>
|
||||
}
|
||||
|
||||
const dateNow = dayjs()
|
||||
const expireTime = dayjs(record.createdAt).add(value)
|
||||
if (expireTime.isBefore(dateNow)) {
|
||||
return <span>Просрочен</span>
|
||||
}
|
||||
|
||||
const formatTime = expireTime.format(dateFormats.fullFormat)
|
||||
return <span>{formatTime}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user