作者 yangfu

修改配置

@@ -89,7 +89,7 @@ func CreateUploadImage(client *vod.Client, r *CreateUploadImageRequest) (respons @@ -89,7 +89,7 @@ func CreateUploadImage(client *vod.Client, r *CreateUploadImageRequest) (respons
89 } 89 }
90 request.ImageExt = filepath.Ext(r.FileName)[1:] 90 request.ImageExt = filepath.Ext(r.FileName)[1:]
91 if !ValidFileExt(ImageFileExt, r.FileName) { 91 if !ValidFileExt(ImageFileExt, r.FileName) {
92 - request.ImageExt = "jpeg" 92 + request.ImageExt = "jpg"
93 } 93 }
94 request.AcceptFormat = "JSON" 94 request.AcceptFormat = "JSON"
95 //request.StorageLocation = filepath.Base(request.Title) 95 //request.StorageLocation = filepath.Base(request.Title)
@@ -76,9 +76,9 @@ func CreateUploadImage(header *protocol.RequestHeader, request *aliyun.CreateUpl @@ -76,9 +76,9 @@ func CreateUploadImage(header *protocol.RequestHeader, request *aliyun.CreateUpl
76 if len(request.FileName) == 0 { 76 if len(request.FileName) == 0 {
77 request.FileName = aliyun.DefaultImageFileName 77 request.FileName = aliyun.DefaultImageFileName
78 } 78 }
79 - //if !aliyun.ValidFileExt(aliyun.ImageFileExt, request.FileName) {  
80 - // return nil, aliyun.OssErrFileFormat  
81 - //} 79 + if !aliyun.ValidFileExt(aliyun.ImageFileExt, request.FileName) {
  80 + return nil, aliyun.OssErrFileFormat
  81 + }
82 request.Title = utils.GetFileName(header.AppProject, aliyun.FileImage, request.FileName) 82 request.Title = utils.GetFileName(header.AppProject, aliyun.FileImage, request.FileName)
83 rsp, err = aliyun.CreateUploadImage(client, request) 83 rsp, err = aliyun.CreateUploadImage(client, request)
84 rsp.FileURL = rsp.ImageURL 84 rsp.FileURL = rsp.ImageURL