opt: Only create actived upload service

This commit is contained in:
RockYang
2023-09-08 06:46:24 +08:00
parent f7fbaa534d
commit b676f80110
3 changed files with 23 additions and 22 deletions

View File

@@ -21,11 +21,11 @@ func NewUploadHandler(app *core.AppServer, db *gorm.DB, manager *oss.UploaderMan
}
func (h *UploadHandler) Upload(c *gin.Context) {
fileURL, err := h.uploaderManager.GetActiveService().PutFile(c, "file")
fileURL, err := h.uploaderManager.GetUploadHandler().PutFile(c, "file")
if err != nil {
resp.ERROR(c, err.Error())
return
}
resp.SUCCESS(c, fileURL)
}