diff --git a/assets b/assets index 38f5114..6a6fd72 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 38f5114426a43840e4e86e71f0d6d369e2adb7c7 +Subproject commit 6a6fd722f35d3fca9eb1c34297e3f3eae8c9a161 diff --git a/inventory/types/types.go b/inventory/types/types.go index 44103e4..8bc383a 100644 --- a/inventory/types/types.go +++ b/inventory/types/types.go @@ -90,6 +90,8 @@ type ( UseCname bool `json:"use_cname,omitempty"` // CDN domain does not need to be signed. SourceAuth bool `json:"source_auth,omitempty"` + // QiniuUploadCdn whether to use CDN for Qiniu upload. + QiniuUploadCdn bool `json:"qiniu_upload_cdn,omitempty"` } FileType int diff --git a/pkg/filemanager/driver/qiniu/qiniu.go b/pkg/filemanager/driver/qiniu/qiniu.go index 3df5798..d6dad01 100644 --- a/pkg/filemanager/driver/qiniu/qiniu.go +++ b/pkg/filemanager/driver/qiniu/qiniu.go @@ -67,7 +67,10 @@ func New(ctx context.Context, policy *ent.StoragePolicy, settings setting.Provid } mac := qbox.NewMac(policy.AccessKey, policy.SecretKey) - cfg := &storage.Config{UseHTTPS: true} + cfg := &storage.Config{ + UseHTTPS: true, + UseCdnDomains: policy.Settings.QiniuUploadCdn, + } driver := &Driver{ policy: policy,