feat: 开发持仓、股票信息相关接口
This commit is contained in:
@@ -220,7 +220,7 @@ export class StorageController {
|
||||
/**
|
||||
* 删除文件(需要管理员权限)
|
||||
*/
|
||||
@Delete(':path(*)')
|
||||
@Delete('*path')
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('admin', 'super_admin')
|
||||
@@ -239,6 +239,10 @@ export class StorageController {
|
||||
@ApiResponse({ status: 401, description: '未授权' })
|
||||
@ApiResponse({ status: 403, description: '权限不足' })
|
||||
async delete(@Param('path') filePath: string) {
|
||||
await this.storageService.delete(filePath);
|
||||
// 移除路径开头的 /,如果有的话
|
||||
const cleanPath = filePath.startsWith('/')
|
||||
? filePath.substring(1)
|
||||
: filePath;
|
||||
await this.storageService.delete(cleanPath);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user