Feat: generate upload credentials for upyun

This commit is contained in:
HFO4
2020-01-17 14:05:51 +08:00
parent 3da87ba7cf
commit f7ecbce64c
5 changed files with 135 additions and 0 deletions

View File

@@ -151,6 +151,7 @@ func (fs *FileSystem) GetUploadToken(ctx context.Context, path string, size uint
if fs.User.Policy.IsPathGenerateNeeded() {
ctx = context.WithValue(ctx, fsctx.SavePathCtx, fs.GenerateSavePath(ctx, local.FileStream{}))
}
ctx = context.WithValue(ctx, fsctx.FileSizeCtx, size)
// 获取上传凭证
callbackKey := util.RandStringRunes(32)