合并多余文件
This commit is contained in:
@@ -91,37 +91,6 @@ model token {
|
|||||||
updatetime DateTime @default(now()) @db.DateTime(0)
|
updatetime DateTime @default(now()) @db.DateTime(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
model change_city {
|
|
||||||
id Int @id @default(autoincrement())
|
|
||||||
time DateTime? @db.Timestamp(0)
|
|
||||||
city_id Int?
|
|
||||||
count Int?
|
|
||||||
offset_old Int?
|
|
||||||
offset_new Int?
|
|
||||||
|
|
||||||
@@index([time], map: "change_city_time_index")
|
|
||||||
}
|
|
||||||
|
|
||||||
model Account {
|
|
||||||
id String @id @default(cuid())
|
|
||||||
userId Int @map("user_id")
|
|
||||||
type String
|
|
||||||
provider String
|
|
||||||
providerAccountId String @map("provider_account_id")
|
|
||||||
refresh_token String? @db.Text
|
|
||||||
access_token String? @db.Text
|
|
||||||
expires_at Int?
|
|
||||||
token_type String?
|
|
||||||
scope String?
|
|
||||||
id_token String? @db.Text
|
|
||||||
session_state String?
|
|
||||||
|
|
||||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
||||||
|
|
||||||
@@unique([provider, providerAccountId])
|
|
||||||
@@map("accounts")
|
|
||||||
}
|
|
||||||
|
|
||||||
model User {
|
model User {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
account String @unique
|
account String @unique
|
||||||
@@ -130,7 +99,6 @@ model User {
|
|||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
sessions Session[]
|
sessions Session[]
|
||||||
accounts Account[]
|
|
||||||
|
|
||||||
@@map("users")
|
@@map("users")
|
||||||
}
|
}
|
||||||
@@ -145,15 +113,3 @@ model Session {
|
|||||||
@@index([userId])
|
@@index([userId])
|
||||||
@@map("sessions")
|
@@map("sessions")
|
||||||
}
|
}
|
||||||
|
|
||||||
model VerificationCode {
|
|
||||||
id Int @id @default(autoincrement())
|
|
||||||
account String
|
|
||||||
code String
|
|
||||||
type String
|
|
||||||
expiresAt DateTime
|
|
||||||
createdAt DateTime @default(now())
|
|
||||||
|
|
||||||
@@index([account, type])
|
|
||||||
@@map("verification_codes")
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { validateNumber } from '@/lib/formatters'
|
import { validateNumber } from '@/lib/utils'
|
||||||
import { Pagination } from '@/components/ui/pagination'
|
import { Pagination } from '@/components/ui/pagination'
|
||||||
import { Table, TableHeader, TableBody, TableHead, TableRow, TableCell } from '@/components/ui/table'
|
import { Table, TableHeader, TableBody, TableHead, TableRow, TableCell } from '@/components/ui/table'
|
||||||
import { getEdgeNodes } from '@/actions/stats'
|
import { getEdgeNodes } from '@/actions/stats'
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
// 数据验证函数
|
|
||||||
export const validateNumber = (value: unknown): number => {
|
|
||||||
if (typeof value === 'number') return value
|
|
||||||
if (typeof value === 'string') {
|
|
||||||
const num = parseInt(value)
|
|
||||||
return isNaN(num) ? 0 : num
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,17 @@
|
|||||||
import { clsx, type ClassValue } from 'clsx'
|
import { clsx, type ClassValue } from 'clsx'
|
||||||
import { twMerge } from 'tailwind-merge'
|
import { twMerge } from 'tailwind-merge'
|
||||||
|
|
||||||
|
// 合并 className
|
||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs))
|
return twMerge(clsx(inputs))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 数据验证函数
|
||||||
|
export const validateNumber = (value: unknown): number => {
|
||||||
|
if (typeof value === 'number') return value
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
const num = parseInt(value)
|
||||||
|
return isNaN(num) ? 0 : num
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user