diff --git a/utils/qrcode/creator.go b/utils/qrcode/creator.go index ab023082..17d616e7 100644 --- a/utils/qrcode/creator.go +++ b/utils/qrcode/creator.go @@ -34,7 +34,10 @@ func CreateQrCodeBs64WithLogo(content, outPath string, logoPath string, size, x, _ = png.Encode(buf, outImg) if outPath != "" { // 写入文件 - f, _ := os.Create(outPath) + f, err := os.Create(outPath) + if err != nil { + return "", err + } defer f.Close() err = png.Encode(f, outImg) if err != nil {