Commit 5e032adb authored by mingyard's avatar mingyard

feat:暂时恢复流文件下载

parent 9b01570a
......@@ -200,15 +200,15 @@ export class TranslateService {
throw BadRequestError.default('下载翻译图片失败');
}
// // 设置响应头
// res.setHeader('Content-Type', 'image/jpeg'); // 根据实际文件类型设置
// res.setHeader('Content-Disposition', 'attachment; filename="image.jpg"'); // 设置下载文件名
// 设置响应头
res.setHeader('Content-Type', 'image/jpeg'); // 根据实际文件类型设置
res.setHeader('Content-Disposition', 'attachment; filename="image.jpg"'); // 设置下载文件名
// // 将文件流返回给前端
// response.data.pipe(res);
// 将文件流返回给前端
response.data.pipe(res);
// 上传图频到服务器
return await this.uploadStream(response.data);
// return await this.uploadStream(response.data);
}
async uploadStream(stream) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment