refactor(api): 移除上传文件时的Content-Type参数

- 删除UploadFileToOSS函数中的contentType参数
- 更新所有调用UploadFileToOSS的地方,移除传递的Content-Type值
- 简化上传逻辑,不再手动设置HTTP请求头中的Content-Type
- 依赖服务器端自动检测文件类型进行处理
This commit is contained in:
2025-11-24 17:56:05 +08:00
parent 67968abcf3
commit f10b68e487
2 changed files with 5 additions and 5 deletions

View File

@@ -189,12 +189,11 @@ func SubmitFailure(ctx context.Context, taskID int64, errorCode, errorMessage st
return nil
}
func UploadFileToOSS(ctx context.Context, uploadUrl string, data []byte, contentType string) error {
func UploadFileToOSS(ctx context.Context, uploadUrl string, data []byte) error {
req, err := http.NewRequestWithContext(ctx, "PUT", uploadUrl, bytes.NewReader(data))
if err != nil {
return err
}
req.Header.Set("Content-Type", contentType)
resp, err := GetUploadClient().Do(req)
if err != nil {