Compare commits

..

No commits in common. "55275db61886e7da151f5888e9390e3c96a07d6f" and "2ba0097a063397694eb192633a9f4dee83a7cef0" have entirely different histories.

View File

@ -56,12 +56,13 @@ type PutRet struct {
User string `json:"user"`
}
func New(accessKey, secretKey, bucket, domain, securityKey string, region *storage.Region) QiNiu {
func New(accessKey, secretKey, bucket, domain, securityKey string) QiNiu {
region, _ := storage.GetRegion(accessKey, bucket)
mac := qbox.NewMac(accessKey, secretKey)
conf := &storage.Config{
Region: region, //空间所在的存储区域
UseHTTPS: true, //是否使用https域名
UseCdnDomains: false, //上传是否使用CDN上传加速
UseCdnDomains: true, //上传是否使用CDN上传加速
}
return &qiNiu{
mac: mac,
@ -215,7 +216,7 @@ func (q *qiNiu) GetFileHash(path, qhash string) (hash string, err error) {
}
sign := q.TimestampSecuritySign(path, time.Second*5)
addr := fmt.Sprintf("%s/%s?%s&qhash/%s", strings.TrimRight(q.domain, "/"), path, sign, qhash)
addr := fmt.Sprintf("https://cdn.mogume.com/%s?%s&qhash/%s", path, sign, qhash)
resp, err := http.Get(addr)
if err != nil {