s3 presigned test

This commit is contained in:
withchao
2023-07-10 19:50:47 +08:00
parent 2f1d9f6265
commit e62f5d8d7c
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -55,6 +55,13 @@ func (o *ThirdApi) AccessURL(c *gin.Context) {
func (o *ThirdApi) ObjectRedirect(c *gin.Context) {
name := c.Param("name")
if name == "" {
c.String(http.StatusBadRequest, "name is empty")
return
}
if name[0] == '/' {
name = name[1:]
}
operationID := c.Query("operationID")
if operationID == "" {
operationID = strconv.Itoa(rand.Int())