mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-09 17:57:06 +08:00
feat: User Management
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
export function formatTimestamp(timestamp: number, format: string = 'YYYY-MM-DD'): string {
|
||||
if (!timestamp) {
|
||||
return '-'
|
||||
}
|
||||
|
||||
const date = new Date(timestamp)
|
||||
const year = date.getFullYear()
|
||||
const month = String(date.getMonth() + 1).padStart(2, '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')
|
||||
|
||||
return format.replace(/YYYY|MM|DD|HH|mm|ss/g, (match) => {
|
||||
switch (match) {
|
||||
case 'YYYY':
|
||||
return String(year)
|
||||
case 'MM':
|
||||
return month
|
||||
case 'DD':
|
||||
return day
|
||||
case 'HH':
|
||||
return hours
|
||||
case 'mm':
|
||||
return minutes
|
||||
case 'ss':
|
||||
return seconds
|
||||
default:
|
||||
return match
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -71,7 +71,7 @@ class HttpService {
|
||||
}
|
||||
|
||||
// Request logging
|
||||
console.log(`[Request] ${config.method?.toUpperCase()} ${config.url}`)
|
||||
// console.log(`[Request] ${config.method?.toUpperCase()} ${config.url}`)
|
||||
|
||||
return config
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user