Feat: remote file thumb preview

This commit is contained in:
HFO4
2020-01-02 13:31:41 +08:00
parent b6102c3ae5
commit 9c48f4b7ad
6 changed files with 37 additions and 15 deletions

View File

@@ -106,7 +106,7 @@ func (handler Handler) Thumb(ctx context.Context, path string) (*response.Conten
sourcePath := base64.RawURLEncoding.EncodeToString([]byte(path))
thumbURL := handler.getAPI("thumb") + "/" + sourcePath
ttl := model.GetIntSetting("slave_api_timeout", 60)
signedThumbURL, err := auth.SignURI(handler.AuthInstance, thumbURL, int64(ttl))
signedThumbURL, err := auth.SignURI(handler.AuthInstance, thumbURL, time.Now().Unix()+int64(ttl))
if err != nil {
return nil, err
}