This commit is contained in:
withchao
2023-03-15 11:24:59 +08:00
parent 316fa10257
commit e9865539de
7 changed files with 144 additions and 140 deletions
+6
View File
@@ -1,6 +1,7 @@
package third
import (
"OpenIM/pkg/common/tokenverify"
"OpenIM/pkg/proto/third"
"context"
"time"
@@ -19,6 +20,11 @@ func (t *thirdServer) ConfirmPut(ctx context.Context, req *third.ConfirmPutReq)
}
func (t *thirdServer) GetUrl(ctx context.Context, req *third.GetUrlReq) (*third.GetUrlResp, error) {
if req.Expires <= 0 {
if err := tokenverify.CheckAdmin(ctx); err != nil {
return nil, err
}
}
return t.s3dataBase.GetUrl(ctx, req)
}