fix: 应该调用filepath.Ext的地方调用了path.Ext (#1696)

* fix: 应该调用filepath.Ext的地方调用了path.Ext

* fix: typo
This commit is contained in:
ShuBo6
2024-04-03 16:25:09 +08:00
committed by GitHub
parent c226a9476f
commit 53e9f931f2
2 changed files with 6 additions and 6 deletions

View File

@@ -5,7 +5,7 @@ import (
"io"
"mime/multipart"
"os"
"path"
"path/filepath"
"strings"
"time"
@@ -27,7 +27,7 @@ type Local struct{}
func (*Local) UploadFile(file *multipart.FileHeader) (string, string, error) {
// 读取文件后缀
ext := path.Ext(file.Filename)
ext := filepath.Ext(file.Filename)
// 读取文件名并加密
name := strings.TrimSuffix(file.Filename, ext)
name = utils.MD5V([]byte(name))