feat(qiniu): use accelerated upload domain (#2497)
This commit is contained in:
2
assets
2
assets
Submodule assets updated: 38f5114426...6a6fd722f3
@@ -90,6 +90,8 @@ type (
|
|||||||
UseCname bool `json:"use_cname,omitempty"`
|
UseCname bool `json:"use_cname,omitempty"`
|
||||||
// CDN domain does not need to be signed.
|
// CDN domain does not need to be signed.
|
||||||
SourceAuth bool `json:"source_auth,omitempty"`
|
SourceAuth bool `json:"source_auth,omitempty"`
|
||||||
|
// QiniuUploadCdn whether to use CDN for Qiniu upload.
|
||||||
|
QiniuUploadCdn bool `json:"qiniu_upload_cdn,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
FileType int
|
FileType int
|
||||||
|
|||||||
@@ -67,7 +67,10 @@ func New(ctx context.Context, policy *ent.StoragePolicy, settings setting.Provid
|
|||||||
}
|
}
|
||||||
|
|
||||||
mac := qbox.NewMac(policy.AccessKey, policy.SecretKey)
|
mac := qbox.NewMac(policy.AccessKey, policy.SecretKey)
|
||||||
cfg := &storage.Config{UseHTTPS: true}
|
cfg := &storage.Config{
|
||||||
|
UseHTTPS: true,
|
||||||
|
UseCdnDomains: policy.Settings.QiniuUploadCdn,
|
||||||
|
}
|
||||||
|
|
||||||
driver := &Driver{
|
driver := &Driver{
|
||||||
policy: policy,
|
policy: policy,
|
||||||
|
|||||||
Reference in New Issue
Block a user