perf: http方式支持校验443端口

This commit is contained in:
xiaojunnuo
2025-05-06 17:01:20 +08:00
parent 826be45b6a
commit d75fcb7fec
2 changed files with 43 additions and 15 deletions

View File

@@ -52,9 +52,11 @@ export class AliossClient {
}
}
async uploadFile(filePath: string, content: Buffer | string) {
async uploadFile(filePath: string, content: Buffer | string, timeout = 1000 * 60 * 60) {
await this.init();
return await this.client.put(filePath, content);
return await this.client.put(filePath, content, {
timeout,
});
}
async removeFile(filePath: string) {
@@ -62,9 +64,11 @@ export class AliossClient {
return await this.client.delete(filePath);
}
async downloadFile(key: string, savePath: string) {
async downloadFile(key: string, savePath: string, timeout = 1000 * 60 * 60) {
await this.init();
return await this.client.get(key, savePath);
return await this.client.get(key, savePath, {
timeout,
});
}
async listDir(dirKey: string) {