|
@@ -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
|