perf: 优化文件下载包名

This commit is contained in:
xiaojunnuo
2024-05-30 10:12:48 +08:00
parent 39ad7597fa
commit d9eb927b0a
17 changed files with 48 additions and 30 deletions
+4 -4
View File
@@ -26,10 +26,10 @@
"@ant-design/icons-vue": "^6.1.0",
"@aws-sdk/client-s3": "^3.383.0",
"@aws-sdk/s3-request-presigner": "^3.383.0",
"@fast-crud/fast-crud": "^1.20.1",
"@fast-crud/fast-extends": "^1.20.1",
"@fast-crud/ui-antdv4": "^1.20.1",
"@fast-crud/ui-interface": "^1.20.1",
"@fast-crud/fast-crud": "^1.20.2",
"@fast-crud/fast-extends": "^1.20.2",
"@fast-crud/ui-antdv4": "^1.20.2",
"@fast-crud/ui-interface": "^1.20.2",
"@iconify/vue": "^4.1.1",
"@soerenmartius/vue3-clipboard": "^0.1.2",
"ant-design-vue": "^4.1.2",
@@ -58,6 +58,7 @@ function install(app: App, options: any = {}) {
buttons: {
view: { type: "link", text: null, icon: "ion:eye-outline" },
edit: { type: "link", text: null, icon: "ion:create-outline" },
copy: {show:true,type: "link", text: null, icon: "ion:copy-outline"},
remove: { type: "link", style: { color: "red" }, text: null, icon: "ion:trash-outline" }
},
dropdown: {
+4 -10
View File
@@ -21,16 +21,10 @@
"mig": "typeorm migration:create -n name"
},
"dependencies": {
"@certd/acme-client": "^1.20.9",
"@certd/pipeline": "^1.20.9",
"@certd/plugin-aliyun": "^1.20.9",
"@certd/plugin-all": "^1.20.9",
"@certd/plugin-center": "^1.20.9",
"@certd/plugin-cert": "^1.20.9",
"@certd/plugin-host": "^1.20.9",
"@certd/plugin-huawei": "^1.20.9",
"@certd/plugin-tencent": "^1.20.9",
"@certd/plugin-util": "^1.20.9",
"@certd/acme-client": "workspace:^1.20.9",
"@certd/pipeline": "workspace:^1.20.9",
"@certd/plugin-cert": "workspace:^1.20.9",
"@certd/plugin-util": "workspace:^1.20.9",
"@alicloud/cs20151215": "^3.0.3",
"@alicloud/openapi-client": "^0.4.0",
"@alicloud/pop-core": "^1.7.10",
@@ -32,6 +32,7 @@ export abstract class CrudController<T> extends BaseController {
@Body(ALL)
bean
) {
delete bean.id;
const id = await this.getService().add(bean);
return this.ok(id);
}
@@ -19,6 +19,7 @@ import { PipelineService } from '../service/pipeline-service';
import { CommonException } from '../../../basic/exception/common-exception';
import { PermissionException } from '../../../basic/exception/permission-exception';
import * as fs from 'fs';
import { logger } from '../../../utils/logger';
/**
* 证书
@@ -151,7 +152,7 @@ export class HistoryController extends CrudController<HistoryService> {
// const filename = file.filename;
// 要下载的文件的完整路径
const path = file.path;
logger.info(`download:${path}`);
// 以流的形式下载文件
this.ctx.attachment(path);
this.ctx.set('Content-Type', 'application/octet-stream');