统一前后端代码格式化配置
This commit is contained in:
@@ -24,10 +24,7 @@ import StatusTag from '@/components/admin/StatusTag'
|
||||
import dayjs from '@/lib/dayjs'
|
||||
import { fetchAdminDashboardSummary, fetchAdminLoginLogs } from '@/services/admin'
|
||||
import type { AdminLoginLogItem } from '@/types/admin'
|
||||
import {
|
||||
ADMIN_DEFAULT_PAGE_SIZE,
|
||||
buildAdminTablePagination,
|
||||
} from '@/utils/admin-pagination'
|
||||
import { ADMIN_DEFAULT_PAGE_SIZE, buildAdminTablePagination } from '@/utils/admin-pagination'
|
||||
import { formatAdminDateTime } from '@/utils/admin-time'
|
||||
|
||||
const cards = [
|
||||
@@ -98,11 +95,7 @@ export default function AdminDashboardPage() {
|
||||
title: '结果',
|
||||
width: 90,
|
||||
render: (_, row) =>
|
||||
row.success ? (
|
||||
<Tag color="green">成功</Tag>
|
||||
) : (
|
||||
<Tag color="red">失败</Tag>
|
||||
),
|
||||
row.success ? <Tag color="green">成功</Tag> : <Tag color="red">失败</Tag>,
|
||||
},
|
||||
{
|
||||
title: '登录地点',
|
||||
@@ -132,8 +125,7 @@ export default function AdminDashboardPage() {
|
||||
const range = Array.isArray(values.dateRange) ? values.dateRange : []
|
||||
const dateFrom =
|
||||
range[0] && dayjs(range[0]).isValid() ? dayjs(range[0]).format('YYYY-MM-DD') : ''
|
||||
const dateTo =
|
||||
range[1] && dayjs(range[1]).isValid() ? dayjs(range[1]).format('YYYY-MM-DD') : ''
|
||||
const dateTo = range[1] && dayjs(range[1]).isValid() ? dayjs(range[1]).format('YYYY-MM-DD') : ''
|
||||
setPage(1)
|
||||
setFilters({
|
||||
username: String(values.username || '').trim(),
|
||||
@@ -223,9 +215,7 @@ export default function AdminDashboardPage() {
|
||||
showIcon
|
||||
style={{ marginBottom: 16 }}
|
||||
message={
|
||||
loginQuery.error instanceof Error
|
||||
? loginQuery.error.message
|
||||
: '读取登录记录失败'
|
||||
loginQuery.error instanceof Error ? loginQuery.error.message : '读取登录记录失败'
|
||||
}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user