feat:增加对svg图片格式支持

This commit is contained in:
lifei6671
2019-03-11 17:36:45 +08:00
parent ad9a4128ba
commit b1979a3fdb
2 changed files with 3 additions and 2 deletions

View File

@@ -452,7 +452,8 @@ func (c *DocumentController) Upload() {
attachment.DocumentId = docId
}
if strings.EqualFold(ext, ".jpg") || strings.EqualFold(ext, ".jpeg") || strings.EqualFold(ext, ".png") || strings.EqualFold(ext, ".gif") {
if filetil.IsImageExt(moreFile.Filename) {
attachment.HttpPath = "/" + strings.Replace(strings.TrimPrefix(filePath, conf.WorkingDirectory), "\\", "/", -1)
if strings.HasPrefix(attachment.HttpPath, "//") {
attachment.HttpPath = conf.URLForWithCdnImage(string(attachment.HttpPath[1:]))