feat: Modify COS file service initialization parameters and URL processing logic

This commit is contained in:
begoniezhao
2025-09-15 20:49:34 +08:00
parent 0908f9c487
commit c2d52a9374
2 changed files with 5 additions and 5 deletions

View File

@@ -216,7 +216,7 @@ func initFileService(cfg *config.Config) (interfaces.FileService, error) {
false,
)
case "cos":
if os.Getenv("COS_APP_ID") == "" ||
if os.Getenv("COS_BUCKET_NAME") == "" ||
os.Getenv("COS_REGION") == "" ||
os.Getenv("COS_SECRET_ID") == "" ||
os.Getenv("COS_SECRET_KEY") == "" ||
@@ -224,7 +224,7 @@ func initFileService(cfg *config.Config) (interfaces.FileService, error) {
return nil, fmt.Errorf("missing COS configuration")
}
return file.NewCosFileService(
os.Getenv("COS_APP_ID"),
os.Getenv("COS_BUCKET_NAME"),
os.Getenv("COS_REGION"),
os.Getenv("COS_SECRET_ID"),
os.Getenv("COS_SECRET_KEY"),