fix: delete backup use body params
Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import { Readable } from 'stream'
|
||||
|
||||
import {
|
||||
BadRequestException,
|
||||
Body,
|
||||
Delete,
|
||||
Get,
|
||||
Header,
|
||||
@@ -92,14 +93,18 @@ export class BackupController {
|
||||
}
|
||||
|
||||
@Delete('/')
|
||||
async deleteBackups(@Query('files') files: string) {
|
||||
if (!files) {
|
||||
return
|
||||
}
|
||||
const _files = files.split(',')
|
||||
for await (const f of _files) {
|
||||
await this.backupService.deleteBackup(f)
|
||||
async deleteBackups(
|
||||
@Query('files') files: string,
|
||||
@Body('files') filesBody: string,
|
||||
) {
|
||||
const nextFiles = files || filesBody
|
||||
if (!nextFiles) {
|
||||
throw new UnprocessableEntityException('参数有误')
|
||||
}
|
||||
|
||||
const filesList = nextFiles.split(',')
|
||||
|
||||
await Promise.all(filesList.map((f) => this.backupService.deleteBackup(f)))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -38,10 +38,10 @@ export class JWTService {
|
||||
'asjhczxiucipoiopiqm2376'
|
||||
|
||||
if (isDev && cluster.isPrimary) {
|
||||
console.log(secret)
|
||||
consola.debug(secret)
|
||||
}
|
||||
if (!CLUSTER.enable || cluster.isPrimary) {
|
||||
console.log(
|
||||
consola.debug(
|
||||
'JWT Secret start with :',
|
||||
secret.slice(0, 5) + '*'.repeat(secret.length - 5),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user